Beispiel #1
0
        void Update()
        {
            if (!initialized_)
            {
                return;
            }
#if UNITY_EDITOR
            muscle_motion_.getRootNode().set(GetComponent <MuscleMotionRenderer>().getRootTransform());

            muscle_motion_.setTarget(posture_);
            muscle_motion_.set(GetComponent <MuscleMotionRenderer>().getRootTransform(), MuscleMotion.Parts.Root);
            muscle_motion_.update(1f / 60f);
            draw_buffer_.beginRender();
            muscle_motion_.renderUpdate(ref draw_buffer_, DrawBuffer.Type.MuscleMotionPlayer);
            draw_buffer_.endRender();

            for (var i = 0; i < draw_buffer_.object_num_; ++i)
            {
                switch (draw_buffer_.object_buffer_[i].type_)
                {
                case DrawBuffer.Type.MuscleMotionPlayer:
                    int parts = draw_buffer_.object_buffer_[i].versatile_data_;
                    if (parts == (int)MuscleMotion.Parts.Root)
                    {
                        break;
                    }
                    GetComponent <MuscleMotionRenderer>().render(ref draw_buffer_.object_buffer_[i]);
                    break;
                }
            }
#endif // UNITY_EDITOR
        }
Beispiel #2
0
 public override void renderUpdate(int front, CameraBase camra, ref DrawBuffer draw_buffer)
 {
     muscle_motion_.renderUpdate(ref draw_buffer, DrawBuffer.Type.MuscleMotionPlayer);
 }