Exemple #1
0
        protected override Joint OnCreateJointByType(Joint.Type jointType, Body body1, Body body2)
        {
            switch (jointType)
            {
            case Joint.Type.Hinge: return(new PhysXHingeJoint(body1, body2));

            case Joint.Type.Universal: return(new PhysXUniversalJoint(body1, body2));

            case Joint.Type.Hinge2: return(new PhysXHinge2Joint(body1, body2));

            case Joint.Type.Ball: return(new PhysXBallJoint(body1, body2));

            case Joint.Type.Slider: return(new PhysXSliderJoint(body1, body2));

            case Joint.Type.Fixed: return(new PhysXFixedJoint(body1, body2));

            //case Joint.Type.Distance: return new PhysXDistanceJoint( body1, body2 );

            //custom joint creation
            case Joint.Type._Custom1: return(new _Custom1Joint(body1, body2));
            }

            Log.Fatal("PhysXPhysicsScene: OnCreateJointByType: Joint type \"{0}\" is not supported.", jointType);
            return(null);
        }
Exemple #2
0
        public override bool IsCustomJointImplemented(Joint.Type jointType)
        {
            //uncomment it to enable _Custom1Joint joint class.
            //if( jointType == Joint.Type._Custom1 )
            //   return true;

            return(false);
        }
Exemple #3
0
    public void Add(Vector2 position, float aliveFor = 1, Joint.Type type = Joint.Type.NOSE)
    {
        Joint joint = new Joint()
        {
            Position  = position,
            AliveFor  = aliveFor,
            StartAt   = 0,
            JointType = type
        };

        AddChild(joint);
        _ActiveJoints.Add(joint);
    }
Exemple #4
0
    public void OnJointExpired(Joint.Type type, Vector2 expected)
    {
        Vector2 real;

        switch (type)
        {
        case Joint.Type.NOSE:  real = _Coords.Nose;   break;

        case Joint.Type.RHAND: real = _Coords.RWrist; break;

        case Joint.Type.LHAND: real = _Coords.LWrist; break;

        default: real = new Vector2(); break;
        }
        Score.Step((int)real.DistanceTo(expected));
    }
Exemple #5
0
 public override bool IsCustomJointImplemented(Joint.Type jointType)
 {
     return(false);
 }