func (j BallJoint) SetAnchor2(pt Vector3) {
	C.dJointSetBallAnchor2(j.c(), C.dReal(pt[0]), C.dReal(pt[1]), C.dReal(pt[2]))
}
SetAnchor2 sets the anchor point for the second body.
package ode
import "C"
import (
	"unsafe"
)
const (
	BallJointType         = C.dJointTypeBall
	HingeJointType        = C.dJointTypeHinge
	SliderJointType       = C.dJointTypeSlider
	ContactJointType      = C.dJointTypeContact
	UniversalJointType    = C.dJointTypeUniversal
	Hinge2JointType       = C.dJointTypeHinge2
	FixedJointType        = C.dJointTypeFixed
	NullJointType         = C.dJointTypeNull
	AMotorJointType       = C.dJointTypeAMotor
	LMotorJointType       = C.dJointTypeLMotor
	Plane2DJointType      = C.dJointTypePlane2D
	PRJointType           = C.dJointTypePR
	PUJointType           = C.dJointTypePU
	PistonJointType       = C.dJointTypePiston
	DBallJointType        = C.dJointTypeDBall
	DHingeJointType       = C.dJointTypeDHinge
	TransmissionJointType = C.dJointTypeTransmission
)
const (
	LoStopJtParam        = C.dParamLoStop
	HiStopJtParam        = C.dParamHiStop
	VelJtParam           = C.dParamVel
	LoVelJtParam         = C.dParamLoVel
	HiVelJtParam         = C.dParamHiVel
	FMaxJtParam          = C.dParamFMax
	FudgeFactorJtParam   = C.dParamFudgeFactor
	BounceJtParam        = C.dParamBounce
	CFMJtParam           = C.dParamCFM
	StopERPJtParam       = C.dParamStopERP
	StopCFMJtParam       = C.dParamStopCFM
	SuspensionERPJtParam = C.dParamSuspensionERP
	SuspensionCFMJtParam = C.dParamSuspensionCFM
	ERPJtParam           = C.dParamERP
	NumJtParams = C.dParamsInGroup
	JtParamGroup1         = C.dParamGroup1
	LoStopJtParam1        = C.dParamLoStop1
	HiStopJtParam1        = C.dParamHiStop1
	VelJtParam1           = C.dParamVel1
	LoVelJtParam1         = C.dParamLoVel1
	HiVelJtParam1         = C.dParamHiVel1
	FMaxJtParam1          = C.dParamFMax1
	FudgeFactorJtParam1   = C.dParamFudgeFactor1
	BounceJtParam1        = C.dParamBounce1
	CFMJtParam1           = C.dParamCFM1
	StopERPJtParam1       = C.dParamStopERP1
	StopCFMJtParam1       = C.dParamStopCFM1
	SuspensionERPJtParam1 = C.dParamSuspensionERP1
	SuspensionCFMJtParam1 = C.dParamSuspensionCFM1
	ERPJtParam1           = C.dParamERP1
	JtParamGroup2         = C.dParamGroup2
	LoStopJtParam2        = C.dParamLoStop2
	HiStopJtParam2        = C.dParamHiStop2
	VelJtParam2           = C.dParamVel2
	LoVelJtParam2         = C.dParamLoVel2
	HiVelJtParam2         = C.dParamHiVel2
	FMaxJtParam2          = C.dParamFMax2
	FudgeFactorJtParam2   = C.dParamFudgeFactor2
	BounceJtParam2        = C.dParamBounce2
	CFMJtParam2           = C.dParamCFM2
	StopERPJtParam2       = C.dParamStopERP2
	StopCFMJtParam2       = C.dParamStopCFM2
	SuspensionERPJtParam2 = C.dParamSuspensionERP2
	SuspensionCFMJtParam2 = C.dParamSuspensionCFM2
	ERPJtParam2           = C.dParamERP2
	JtParamGroup3         = C.dParamGroup3
	LoStopJtParam3        = C.dParamLoStop3
	HiStopJtParam3        = C.dParamHiStop3
	VelJtParam3           = C.dParamVel3
	LoVelJtParam3         = C.dParamLoVel3
	HiVelJtParam3         = C.dParamHiVel3
	FMaxJtParam3          = C.dParamFMax3
	FudgeFactorJtParam3   = C.dParamFudgeFactor3
	BounceJtParam3        = C.dParamBounce3
	CFMJtParam3           = C.dParamCFM3
	StopERPJtParam3       = C.dParamStopERP3
	StopCFMJtParam3       = C.dParamStopCFM3
	SuspensionERPJtParam3 = C.dParamSuspensionERP3
	SuspensionCFMJtParam3 = C.dParamSuspensionCFM3
	ERPJtParam3           = C.dParamERP3
)
const (
	AMotorUser  = C.dAMotorUser
	AMotorEuler = C.dAMotorEuler
)
const (
	TransmissionParallelAxes     = C.dTransmissionParallelAxes
	TransmissionIntersectingAxes = C.dTransmissionIntersectingAxes
	TransmissionChainDrive       = C.dTransmissionChainDrive
)
var (
	jointData = map[Joint]interface{}{}
)
type JointFeedback struct {
	Force1  Vector3  
	Torque1 Vector3  
	Force2  Vector3  
	Torque2 Vector3  
}
func (f *JointFeedback) fromC(c *C.dJointFeedback) {
	Vector(f.Force1).fromC(&c.f1[0])
	Vector(f.Torque1).fromC(&c.t1[0])
	Vector(f.Force2).fromC(&c.f2[0])
	Vector(f.Torque2).fromC(&c.t2[0])
}
func (f *JointFeedback) toC(c *C.dJointFeedback) {
	Vector(f.Force1).toC((*C.dReal)(&c.f1[0]))
	Vector(f.Torque1).toC((*C.dReal)(&c.t1[0]))
	Vector(f.Force2).toC((*C.dReal)(&c.f2[0]))
	Vector(f.Torque2).toC((*C.dReal)(&c.t2[0]))
}
type JointGroup uintptr
func NewJointGroup(maxJoints int) JointGroup {
	return cToJointGroup(C.dJointGroupCreate(C.int(maxJoints)))
}
func cToJointGroup(c C.dJointGroupID) JointGroup {
	return JointGroup(unsafe.Pointer(c))
}
func (g JointGroup) c() C.dJointGroupID {
	return C.dJointGroupID(unsafe.Pointer(g))
}
func (g JointGroup) Destroy() {
	C.dJointGroupDestroy(g.c())
}
func (g JointGroup) Empty() {
	C.dJointGroupEmpty(g.c())
}
type Joint interface {
	c() C.dJointID
	Destroy()
	SetData(data interface{})
	Data() interface{}
	NumBodies() int
	Attach(body1, body2 Body)
	SetEnabled(isEnabled bool)
	Enabled() bool
	Type() int
	Body(index int) Body
	SetFeedback(f *JointFeedback)
	Feedback() *JointFeedback
}
type JointBase uintptr
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
}
func (j JointBase) c() C.dJointID {
	return C.dJointID(unsafe.Pointer(j))
}
func (j JointBase) Destroy() {
	delete(jointData, j)
	C.dJointDestroy(j.c())
}
func (j JointBase) SetData(data interface{}) {
	jointData[j] = data
}
func (j JointBase) Data() interface{} {
	return jointData[j]
}
func (j JointBase) NumBodies() int {
	return int(C.dJointGetNumBodies(j.c()))
}
func (j JointBase) Attach(body1, body2 Body) {
	C.dJointAttach(j.c(), body1.c(), body2.c())
}
func (j JointBase) SetEnabled(isEnabled bool) {
	if isEnabled {
		C.dJointEnable(j.c())
	} else {
		C.dJointDisable(j.c())
	}
}
func (j JointBase) Enabled() bool {
	return bool(C.dJointIsEnabled(j.c()) != 0)
}
func (j JointBase) Type() int {
	return int(C.dJointGetType(j.c()))
}
func (j JointBase) Body(index int) Body {
	return cToBody(C.dJointGetBody(j.c(), C.int(index)))
}
func (j JointBase) SetFeedback(f *JointFeedback) {
	c := &C.dJointFeedback{}
	f.toC(c)
	C.dJointSetFeedback(j.c(), c)
}
func (j JointBase) Feedback() *JointFeedback {
	f := &JointFeedback{}
	f.fromC(C.dJointGetFeedback(j.c()))
	return f
}
type BallJoint struct {
	JointBase
}
func (j BallJoint) SetParam(parameter int, value float64) {
	C.dJointSetBallParam(j.c(), C.int(parameter), C.dReal(value))
}
func (j BallJoint) Param(parameter int) float64 {
	return float64(C.dJointGetBallParam(j.c(), C.int(parameter)))
}
func (j BallJoint) SetAnchor(pt Vector3) {
	C.dJointSetBallAnchor(j.c(), C.dReal(pt[0]), C.dReal(pt[1]), C.dReal(pt[2]))
}
func (j BallJoint) Anchor() Vector3 {
	pt := NewVector3()
	C.dJointGetBallAnchor(j.c(), (*C.dReal)(&pt[0]))
	return pt
}