Examples of MeshAnimationFrame


Examples of org.terasology.rendering.assets.animation.MeshAnimationFrame

                    while ((int) framePos >= skeletalMeshComp.animation.getFrameCount()) {
                        framePos -= skeletalMeshComp.animation.getFrameCount();
                        skeletalMeshComp.animationTime -= skeletalMeshComp.animation.getTimePerFrame() * skeletalMeshComp.animation.getFrameCount();
                    }
                    int frameId = (int) framePos;
                    MeshAnimationFrame frameA = skeletalMeshComp.animation.getFrame(frameId);
                    MeshAnimationFrame frameB = skeletalMeshComp.animation.getFrame((frameId + 1) % skeletalMeshComp.animation.getFrameCount());
                    updateSkeleton(skeletalMeshComp, frameA, frameB, framePos - frameId);
                } else {
                    if ((int) framePos >= skeletalMeshComp.animation.getFrameCount()) {
                        MeshAnimationFrame frame = skeletalMeshComp.animation.getFrame(skeletalMeshComp.animation.getFrameCount() - 1);
                        updateSkeleton(skeletalMeshComp, frame, frame, 1.0f);
                        MeshAnimation animation = skeletalMeshComp.animation;
                        skeletalMeshComp.animationTime = 0;
                        skeletalMeshComp.animation = null;
                        entity.send(new AnimEndEvent(animation));
                    } else {
                        int frameId = (int) framePos;
                        MeshAnimationFrame frameA = skeletalMeshComp.animation.getFrame(frameId);
                        MeshAnimationFrame frameB = (frameId + 1 >= skeletalMeshComp.animation.getFrameCount()) ? frameA : skeletalMeshComp.animation.getFrame(frameId + 1);
                        updateSkeleton(skeletalMeshComp, frameA, frameB, framePos - frameId);
                    }
                }
                entity.saveComponent(skeletalMeshComp);
            }
View Full Code Here

Examples of org.terasology.rendering.assets.animation.MeshAnimationFrame

            // Rotate just the root bone to correct for coordinate system differences
            rotations.set(0, MD5ParserCommon.correctQuat4f(rotations.get(0)));
            positions.set(0, MD5ParserCommon.correctOffset(positions.get(0)));


            frames.add(new MeshAnimationFrame(positions, rotations));

        }

        return new MeshAnimationData(boneNames, boneParents, frames, timePerFrame);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.