Exemple #1
0
// NewPlane creates a plane located on the origin and oriented by the
// plane normal nx, ny, nz.
func NewPlane(nx, ny, nz float64) physics.Body {
	return physics.NewBody(physics.NewPlane(nx, ny, nz))
}
Exemple #2
0
// NewSphere creates a ball shaped physics body located at the origin.
// The sphere size is defined by the radius.
func NewSphere(radius float64) physics.Body {
	return physics.NewBody(physics.NewSphere(radius))
}
Exemple #3
0
// NewRay creates a ray located at the origin and pointing in the
// direction dx, dy, dz.
func NewRay(dx, dy, dz float64) physics.Body {
	return physics.NewBody(physics.NewRay(dx, dy, dz))
}
Exemple #4
0
// NewBox creates a box shaped physics body located at the origin.
// The box size is given by the half-extents so that actual size
// is w=2*hx, h=2*hy, d=2*hz.
func NewBox(hx, hy, hz float64) physics.Body {
	return physics.NewBody(physics.NewBox(hx, hy, hz))
}