예제 #1
0
파일: Joint.cs 프로젝트: rpenido/obstavoid
 public Joint(Link parentLink, Vector3 position, double minValue, double maxValue, double velocity)
 {
     this.parentLink = parentLink;
     this.position = position;
     this.minValue = minValue;
     this.maxValue = maxValue;
     this.velocity = velocity;
     setPending();
 }
예제 #2
0
        private void DrawLink(Link link)
        {
            Matrix[] transforms = new Matrix[link.Model.Bones.Count];
            link.Model.CopyBoneTransformsTo(transforms);

            foreach (ModelMesh mesh in link.Model.Meshes)
            {
                foreach (BasicEffect effect in mesh.Effects)
                {
                    effect.EnableDefaultLighting();

                    effect.View = camera.View;
                    effect.Projection = camera.Projection;

                    effect.World =  transforms[mesh.ParentBone.Index] *
                        link.Transform;
                    mesh.Draw();
                }

            }
        }
예제 #3
0
 public RevoluteJoint(Link parentLink, Vector3 position, float angle, Vector3 axis, double minValue, double maxValue, double velocity)
     : base(parentLink, position, minValue, maxValue, velocity)
 {
     this.Value = angle;
     this.axis = axis;
 }
예제 #4
0
파일: Octree.cs 프로젝트: rpenido/obstavoid
 public bool IsColliding(Link link)
 {
     if (link.Intersects(obb))
     {
         if (octree != null)
         {
             foreach (OctreeNode oct in octree)
             {
                 bool collision = oct.IsColliding(link);
                 if (collision)
                     return true;
             }
         }
         else
         {
             foreach (TriangleData tri in triangles)
             {
                 if (link.Intersects(tri))
                 {
                     return true;
                 }
             }
         }
     }
     return false;
 }
예제 #5
0
 public PrismaticJoint(Link parentLink, Vector3 position, float displacement, Vector3 axis, double minValue, double maxValue, double velocity)
     : base(parentLink, position, minValue, maxValue, velocity)
 {
     this.Value = displacement;
     this.axis = axis;
 }