Documentation ¶
Index ¶
- func CalculateCuboidInertia(width float64, height float64, depth float64, mass float64) *mathf.Vec3
- func CalculateSphereInertia(radius float64, mass float64) *mathf.Vec3
- type RigidBody
- func (rigidbody *RigidBody) AddLocalTorque(localTorque *mathf.Vec3)
- func (rigidbody *RigidBody) AddTorque(torque *mathf.Vec3)
- func (rigidbody *RigidBody) ApplyForce(force *mathf.Vec3, relativePoint *mathf.Vec3)
- func (rigidbody *RigidBody) ApplyImpulse(impulse *mathf.Vec3, relativePoint *mathf.Vec3)
- func (rigidbody *RigidBody) ApplyLocalForce(localForce *mathf.Vec3, localPoint *mathf.Vec3)
- func (rigidbody *RigidBody) ApplyLocalImpulse(localImpulse *mathf.Vec3, localPoint *mathf.Vec3)
- func (rigidbody *RigidBody) InverseInertia() *mathf.Vec3
- func (rigidbody *RigidBody) InverseMass() float64
- func (rigidbody *RigidBody) PointToLocalFrame(worldPoint *mathf.Vec3) *mathf.Vec3
- func (rigidbody *RigidBody) PointToWorldFrame(localPoint *mathf.Vec3) *mathf.Vec3
- func (rigidbody *RigidBody) Update(delta float64)
- func (rigidbody *RigidBody) UpdateInertiaWorld(force bool)
- func (rigidbody *RigidBody) VectorToLocalFrame(worldVector *mathf.Vec3) *mathf.Vec3
- func (rigidbody *RigidBody) VectorToWorldFrame(localVector *mathf.Vec3) *mathf.Vec3
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateCuboidInertia ¶
Types ¶
type RigidBody ¶
type RigidBody struct { Mass float64 // World space position of the body. Position *mathf.Vec3 // World space rotational force on the body, around center of mass. Rotation *mathf.Quaternion // World space velocity of the body. Velocity *mathf.Vec3 // Angular velocity of the body, in world space. Think of the angular velocity as a vector, which the body rotates around. The length of this vector determines how fast (in radians per second) the body rotates. AngularVelocity *mathf.Vec3 // Linear force on the body in world space. Force *mathf.Vec3 // World space rotational force on the body, around center of mass. Torque *mathf.Vec3 // LinearFactor use to limit the motion along any world axis. (1,1,1) will allow motion along all axes while (0,0,0) allows none. LinearFactor *mathf.Vec3 // AngularFactor use to limit the rotational motion along any world axis. (1,1,1) will allow rotation along all axes while (0,0,0) allows none. AngularFactor *mathf.Vec3 // moment of inertia components Inertia *mathf.Vec3 InverseInertiaWorld *mathf.Mat3 LinearDamping float64 AngularDamping float64 }
func NewRigidBody ¶
func NewRigidBody() *RigidBody
func (*RigidBody) AddLocalTorque ¶
func (*RigidBody) ApplyForce ¶
func (*RigidBody) ApplyImpulse ¶
func (*RigidBody) ApplyLocalForce ¶
func (*RigidBody) ApplyLocalImpulse ¶
func (*RigidBody) InverseInertia ¶
func (*RigidBody) InverseMass ¶
func (*RigidBody) PointToLocalFrame ¶
func (*RigidBody) PointToWorldFrame ¶
func (*RigidBody) UpdateInertiaWorld ¶
func (*RigidBody) VectorToLocalFrame ¶
Click to show internal directories.
Click to hide internal directories.