Exemple #1
0
func cToJoint(c C.dJointID) Joint {
	base := JointBase(unsafe.Pointer(c))
	var j Joint
	switch int(C.dJointGetType(c)) {
	case BallJointType:
		j = BallJoint{base}
	case HingeJointType:
		j = HingeJoint{base}
	case SliderJointType:
		j = SliderJoint{base}
	case ContactJointType:
		j = ContactJoint{base}
	case UniversalJointType:
		j = UniversalJoint{base}
	case Hinge2JointType:
		j = Hinge2Joint{base}
	case FixedJointType:
		j = FixedJoint{base}
	case NullJointType:
		j = NullJoint{base}
	case AMotorJointType:
		j = AMotorJoint{base}
	case LMotorJointType:
		j = LMotorJoint{base}
	case Plane2DJointType:
		j = Plane2DJoint{base}
	case PRJointType:
		j = PRJoint{base}
	case PUJointType:
		j = PUJoint{base}
	case PistonJointType:
		j = PistonJoint{base}
	case DBallJointType:
		j = DBallJoint{base}
	case DHingeJointType:
		j = DHingeJoint{base}
	case TransmissionJointType:
		j = TransmissionJoint{base}
	default:
		j = base
	}
	return j
}
Exemple #2
0
// Type returns the joint type.
func (j JointBase) Type() int {
	return int(C.dJointGetType(j.c()))
}