2016-06-23 03:49:47 +00:00
|
|
|
/*
|
|
|
|
* Minecraft Forge
|
2019-02-10 22:57:03 +00:00
|
|
|
* Copyright (c) 2016-2019.
|
2016-06-23 03:49:47 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation version 2.1
|
|
|
|
* of the License.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
2016-03-21 07:01:30 +00:00
|
|
|
package net.minecraftforge.common.model.animation;
|
2016-01-01 15:15:48 +00:00
|
|
|
|
2019-12-11 02:27:07 +00:00
|
|
|
import net.minecraft.client.renderer.TransformationMatrix;
|
2016-01-01 15:15:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Various implementations of IJointClip.
|
|
|
|
*/
|
|
|
|
public final class JointClips
|
|
|
|
{
|
|
|
|
public static enum IdentityJointClip implements IJointClip
|
|
|
|
{
|
2016-03-21 07:23:27 +00:00
|
|
|
INSTANCE;
|
2016-01-01 15:15:48 +00:00
|
|
|
|
2017-06-18 01:24:17 +00:00
|
|
|
@Override
|
2019-12-11 02:27:07 +00:00
|
|
|
public TransformationMatrix apply(float time)
|
2016-01-01 15:15:48 +00:00
|
|
|
{
|
2020-02-26 03:45:14 +00:00
|
|
|
return TransformationMatrix.identity();
|
2016-01-01 15:15:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static class NodeJointClip implements IJointClip
|
|
|
|
{
|
|
|
|
private final IJoint child;
|
|
|
|
private final IClip clip;
|
|
|
|
|
|
|
|
public NodeJointClip(IJoint joint, IClip clip)
|
|
|
|
{
|
|
|
|
this.child = joint;
|
|
|
|
this.clip = clip;
|
|
|
|
}
|
|
|
|
|
2017-06-18 01:24:17 +00:00
|
|
|
@Override
|
2019-12-11 02:27:07 +00:00
|
|
|
public TransformationMatrix apply(float time)
|
2016-01-01 15:15:48 +00:00
|
|
|
{
|
|
|
|
return clip.apply(child).apply(time);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|