engine: azul3d.org/engine/native/ode Index | Files

package ode

import "azul3d.org/engine/native/ode"

Package ode provide a Go interface to the Open Dynamics Engine library. See the ODE documentation for more information.

Index

Package Files

body.go contact.go geom.go heightfield.go joint.go mass.go ode.go space.go trimesh.go world.go

Constants

const (
    Mu2CtParam      = C.dContactMu2
    AxisDepCtParam  = C.dContactAxisDep
    FDir1CtParam    = C.dContactFDir1
    BounceCtParam   = C.dContactBounce
    SoftERPCtParam  = C.dContactSoftERP
    SoftCFMCtParam  = C.dContactSoftCFM
    Motion1CtParam  = C.dContactMotion1
    Motion2CtParam  = C.dContactMotion2
    MotionNCtParam  = C.dContactMotionN
    Slip1CtParam    = C.dContactSlip1
    Slip2CtParam    = C.dContactSlip2
    RollingCtParam  = C.dContactRolling
    Approx0CtParam  = C.dContactApprox0
    Approx11CtParam = C.dContactApprox1_1
    Approx12CtParam = C.dContactApprox1_2
    Approx1NCtParam = C.dContactApprox1_N
    Approx1CtParam  = C.dContactApprox1
)

Contact parameter types

const (
    SphereClass             = C.dSphereClass
    BoxClass                = C.dBoxClass
    CapsuleClass            = C.dCapsuleClass
    CylinderClass           = C.dCylinderClass
    PlaneClass              = C.dPlaneClass
    RayClass                = C.dRayClass
    ConvexClass             = C.dConvexClass
    TriMeshClass            = C.dTriMeshClass
    HeightfieldClass        = C.dHeightfieldClass
    SimpleSpaceClass        = C.dSimpleSpaceClass
    HashSpaceClass          = C.dHashSpaceClass
    SweepAndPruneSpaceClass = C.dSweepAndPruneSpaceClass
    QuadTreeSpaceClass      = C.dQuadTreeSpaceClass

    NumClasses = C.dGeomNumClasses

    MaxUserClasses = C.dMaxUserClasses
    FirstUserClass = C.dFirstUserClass
    LastUserClass  = C.dLastUserClass

    FirstSpaceClass = C.dFirstSpaceClass
    LastSpaceClass  = C.dLastSpaceClass
)

Geometry classes

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
)

Joint types

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
)

Joint parameters

const (
    AMotorUser  = C.dAMotorUser
    AMotorEuler = C.dAMotorEuler
)

Angular motor parameters

const (
    TransmissionParallelAxes     = C.dTransmissionParallelAxes
    TransmissionIntersectingAxes = C.dTransmissionIntersectingAxes
    TransmissionChainDrive       = C.dTransmissionChainDrive
)

Transmission parameters

const (
    BasicDataAFlag     = C.dAllocateFlagBasicData
    CollisionDataAFlag = C.dAllocateFlagCollisionData
    AllAFlag           = C.dAllocateMaskAll
)

Allocation flags

const (
    SAPAxesXYZ = C.dSAP_AXES_XYZ
    SAPAxesXZY = C.dSAP_AXES_XZY
    SAPAxesYXZ = C.dSAP_AXES_YXZ
    SAPAxesYZX = C.dSAP_AXES_YZX
    SAPAxesZXY = C.dSAP_AXES_ZXY
    SAPAxesZYX = C.dSAP_AXES_ZYX
)

Sweep and prune axis orders

const (
    ManualThreadCleanupIFlag = C.dInitFlagManualThreadCleanup
)

Initialization flags

const (
    WorldStepThreadCountUnlimited = C.dWORLDSTEP_THREADCOUNT_UNLIMITED
)

World constants

Variables

var (
    V3  = NewVector3
    V4  = NewVector4
    M3  = NewMatrix3
    M4  = NewMatrix4
    Q   = NewQuaternion
    BB  = NewAABB
)

Short constructor aliases for convenience

func CleanupAllDataForThread Uses

func CleanupAllDataForThread()

CleanupAllDataForThread manually releases ODE resources for the current thread.

func Close Uses

func Close()

Close releases ODE resources.

func Init Uses

func Init(initFlags, allocFlags int)

Init initializes ODE.

type AABB Uses

type AABB Vector

AABB represents an axis-aligned bounding box.

func NewAABB Uses

func NewAABB(vals ...float64) AABB

NewAABB returns a new AABB instance.

type AMotorJoint Uses

type AMotorJoint struct {
    JointBase
}

AMotorJoint represents an angular motor joint.

func (AMotorJoint) AddTorques Uses

func (j AMotorJoint) AddTorques(torque1, torque2, torque3 float64)

AddTorques adds torques to the joint.

func (AMotorJoint) Angle Uses

func (j AMotorJoint) Angle(num int) float64

Angle returns the angle of the given axis.

func (AMotorJoint) AngleRate Uses

func (j AMotorJoint) AngleRate(num int) float64

AngleRate returns the angle's rate of change for the given axis.

func (AMotorJoint) Axis Uses

func (j AMotorJoint) Axis(num int) Vector3

Axis returns the given axis.

func (AMotorJoint) AxisRel Uses

func (j AMotorJoint) AxisRel(num int) int

AxisRel returns the relative mode for the given axis.

func (AMotorJoint) Mode Uses

func (j AMotorJoint) Mode() int

Mode returns the mode.

func (AMotorJoint) NumAxes Uses

func (j AMotorJoint) NumAxes() int

NumAxes returns the number of axes.

func (AMotorJoint) Param Uses

func (j AMotorJoint) Param(parameter int) float64

Param returns a joint parameter.

func (AMotorJoint) SetAngle Uses

func (j AMotorJoint) SetAngle(num int, angle float64)

SetAngle sets the angle of the given axis.

func (AMotorJoint) SetAxis Uses

func (j AMotorJoint) SetAxis(num, rel int, axis Vector3)

SetAxis sets the given axis relative to body rel (1 or 2) or none (0).

func (AMotorJoint) SetMode Uses

func (j AMotorJoint) SetMode(mode int)

SetMode sets the mode.

func (AMotorJoint) SetNumAxes Uses

func (j AMotorJoint) SetNumAxes(num int)

SetNumAxes sets the number of axes.

func (AMotorJoint) SetParam Uses

func (j AMotorJoint) SetParam(parameter int, value float64)

SetParam sets a joint parameter.

type BallJoint Uses

type BallJoint struct {
    JointBase
}

BallJoint implements a ball-and-socket joint.

func (BallJoint) Anchor Uses

func (j BallJoint) Anchor() Vector3

Anchor returns the anchor point for the first body.

func (BallJoint) Anchor2 Uses

func (j BallJoint) Anchor2() Vector3

Anchor2 returns the anchor point for the second body.

func (BallJoint) Param Uses

func (j BallJoint) Param(parameter int) float64

Param returns a joint parameter.

func (BallJoint) SetAnchor Uses

func (j BallJoint) SetAnchor(pt Vector3)

SetAnchor sets the anchor point for the first body.

func (BallJoint) SetAnchor2 Uses

func (j BallJoint) SetAnchor2(pt Vector3)

SetAnchor2 sets the anchor point for the second body.

func (BallJoint) SetParam Uses

func (j BallJoint) SetParam(parameter int, value float64)

SetParam sets a joint parameter.

type Body Uses

type Body uintptr

Body represents a rigid body.

func (Body) AddForce Uses

func (b Body) AddForce(force Vector3)

AddForce adds a force in world coordinates at the center of mass.

func (Body) AddForceAtPos Uses

func (b Body) AddForceAtPos(force, pos Vector3)

AddForceAtPos adds a force in world coordinates at the position in world coordinates.

func (Body) AddForceAtRelPos Uses

func (b Body) AddForceAtRelPos(force, pos Vector3)

AddForceAtRelPos adds a force in world coordinates at the position in body coordinates.

func (Body) AddRelForce Uses

func (b Body) AddRelForce(force Vector3)

AddRelForce adds a force in body coordinates at the center of mass.

func (Body) AddRelForceAtPos Uses

func (b Body) AddRelForceAtPos(force, pos Vector3)

AddRelForceAtPos adds a force in body coordinates at the position in world coordinates.

func (Body) AddRelForceAtRelPos Uses

func (b Body) AddRelForceAtRelPos(force, pos Vector3)

AddRelForceAtRelPos adds a force in body coordinates at the position in body coordinates.

func (Body) AddRelTorque Uses

func (b Body) AddRelTorque(torque Vector3)

AddRelTorque adds a torque in body coordinates at the center of mass.

func (Body) AddTorque Uses

func (b Body) AddTorque(torque Vector3)

AddTorque adds a torque in world coordinates at the center of mass.

func (Body) AngularDamping Uses

func (b Body) AngularDamping() float64

AngularDamping returns the angular damping scale.

func (Body) AngularDampingThreshold Uses

func (b Body) AngularDampingThreshold() float64

AngularDampingThreshold returns the angular damping threshold.

func (Body) AngularVel Uses

func (b Body) AngularVel() Vector3

AngularVel returns the angular velocity.

func (Body) AutoDisable Uses

func (b Body) AutoDisable() bool

AutoDisable returns whether the body will be auto disabled.

func (Body) AutoDisableAngularThreshold Uses

func (b Body) AutoDisableAngularThreshold() float64

AutoDisableAngularThreshold returns the auto disable angular average threshold.

func (Body) AutoDisableAverageSamplesCount Uses

func (b Body) AutoDisableAverageSamplesCount() int

AutoDisableAverageSamplesCount returns the auto disable sample count.

func (Body) AutoDisableLinearThreshold Uses

func (b Body) AutoDisableLinearThreshold() float64

AutoDisableLinearThreshold returns the auto disable linear average threshold.

func (Body) AutoDisableSteps Uses

func (b Body) AutoDisableSteps() int

AutoDisableSteps returns the number of auto disable steps.

func (Body) AutoDisableTime Uses

func (b Body) AutoDisableTime() float64

AutoDisableTime returns the auto disable time.

func (Body) Connected Uses

func (b Body) Connected(other Body) bool

Connected returns whether the body is connected to the given body by a joint.

func (Body) ConnectedExcluding Uses

func (b Body) ConnectedExcluding(other Body, jointType int) bool

ConnectedExcluding returns whether the body is connected to the given body by a joint, except for joints of the given class.

func (Body) ConnectingJoint Uses

func (b Body) ConnectingJoint(other Body) Joint

ConnectingJoint returns the first joint connecting the body to the specified body.

func (Body) ConnectingJointList Uses

func (b Body) ConnectingJointList(other Body) []Joint

ConnectingJointList returns a list of joints connecting the body to the specified body.

func (Body) Data Uses

func (b Body) Data() interface{}

Data returns the user-specified data associated with the body.

func (Body) Destroy Uses

func (b Body) Destroy()

Destroy destroys the body.

func (Body) Enabled Uses

func (b Body) Enabled() bool

Enabled returns whether the body is enabled.

func (Body) FiniteRotationAxis Uses

func (b Body) FiniteRotationAxis() Vector3

FiniteRotationAxis returns the finite rotation axis.

func (Body) FiniteRotationMode Uses

func (b Body) FiniteRotationMode() bool

FiniteRotationMode returns whether finite rotation mode is used.

func (Body) FirstGeom Uses

func (b Body) FirstGeom() Geom

FirstGeom returns the first geometry associated with the body.

func (Body) Force Uses

func (b Body) Force() Vector3

Force returns the force acting on the center of mass.

func (Body) GravityEnabled Uses

func (b Body) GravityEnabled() bool

GravityEnabled returns whether gravity affects the body.

func (Body) GyroModeEnabled Uses

func (b Body) GyroModeEnabled() bool

GyroModeEnabled returns whether gyroscopic mode is enabled.

func (Body) Joint Uses

func (b Body) Joint(index int) Joint

Joint returns the joint attached to the body, specified by index.

func (Body) Kinematic Uses

func (b Body) Kinematic() bool

Kinematic returns whether the body is in kinematic mode.

func (Body) LinearDamping Uses

func (b Body) LinearDamping() float64

LinearDamping returns the linear damping scale.

func (Body) LinearDampingThreshold Uses

func (b Body) LinearDampingThreshold() float64

LinearDampingThreshold returns the linear damping threshold.

func (Body) LinearVelocity Uses

func (b Body) LinearVelocity() Vector3

LinearVelocity returns the linear velocity.

func (Body) Mass Uses

func (b Body) Mass() *Mass

Mass returns the mass.

func (Body) MaxAngularSpeed Uses

func (b Body) MaxAngularSpeed() float64

MaxAngularSpeed returns the maximum angular speed.

func (Body) NumJoints Uses

func (b Body) NumJoints() int

NumJoints returns the number of joints attached to the body.

func (Body) PointVel Uses

func (b Body) PointVel(pt Vector3) Vector3

PointVel returns the velocity in world coordinates of a point in world coordinates.

func (Body) PosRelPoint Uses

func (b Body) PosRelPoint(pos Vector3) Vector3

PosRelPoint returns the position in body coordinates of a point in world coordinates.

func (Body) Position Uses

func (b Body) Position() Vector3

Position returns the position.

func (Body) Quaternion Uses

func (b Body) Quaternion() Quaternion

Quaternion returns the orientation represented by a quaternion.

func (Body) RelPointPos Uses

func (b Body) RelPointPos(pt Vector3) Vector3

RelPointPos returns the position in world coordinates of a point in body coordinates.

func (Body) RelPointVel Uses

func (b Body) RelPointVel(pt Vector3) Vector3

RelPointVel returns the velocity in world coordinates of a point in body coordinates.

func (Body) Rotation Uses

func (b Body) Rotation() Matrix3

Rotation returns the orientation represented by a rotation matrix.

func (Body) SetAngularDamping Uses

func (b Body) SetAngularDamping(scale float64)

SetAngularDamping sets the angular damping scale.

func (Body) SetAngularDampingThreshold Uses

func (b Body) SetAngularDampingThreshold(threshold float64)

SetAngularDampingThreshold sets the angular damping threshold.

func (Body) SetAngularVelocity Uses

func (b Body) SetAngularVelocity(vel Vector3)

SetAngularVelocity sets the angular velocity.

func (Body) SetAutoAutoDisableAverageSamplesCount Uses

func (b Body) SetAutoAutoDisableAverageSamplesCount(count int)

SetAutoAutoDisableAverageSamplesCount sets auto disable average sample count.

func (Body) SetAutoDisable Uses

func (b Body) SetAutoDisable(doAutoDisable bool)

SetAutoDisable sets wether the body will be auto disabled.

func (Body) SetAutoDisableAngularThreshold Uses

func (b Body) SetAutoDisableAngularThreshold(thresh float64)

SetAutoDisableAngularThreshold sets the auto disable angular average threshold.

func (Body) SetAutoDisableDefaults Uses

func (b Body) SetAutoDisableDefaults()

SetAutoDisableDefaults sets auto disable settings to default defaults.

func (Body) SetAutoDisableLinearThreshold Uses

func (b Body) SetAutoDisableLinearThreshold(thresh float64)

SetAutoDisableLinearThreshold sets the auto disable linear average threshold.

func (Body) SetAutoDisableSteps Uses

func (b Body) SetAutoDisableSteps(steps int)

SetAutoDisableSteps sets the number of auto disable steps.

func (Body) SetAutoDisableTime Uses

func (b Body) SetAutoDisableTime(time float64)

SetAutoDisableTime sets the auto disable time.

func (Body) SetDampingDefaults Uses

func (b Body) SetDampingDefaults()

SetDampingDefaults sets damping settings to default values.

func (Body) SetData Uses

func (b Body) SetData(data interface{})

SetData associates user-specified data with the body.

func (Body) SetEnabled Uses

func (b Body) SetEnabled(isEnabled bool)

SetEnabled sets whether the body is enabled.

func (Body) SetFiniteRotationAxis Uses

func (b Body) SetFiniteRotationAxis(axis Vector3)

SetFiniteRotationAxis sets the finite rotation axis.

func (Body) SetFiniteRotationMode Uses

func (b Body) SetFiniteRotationMode(isFinite bool)

SetFiniteRotationMode sets whether finite rotation mode is used.

func (Body) SetForce Uses

func (b Body) SetForce(force Vector3)

SetForce sets the force acting on the center of mass.

func (Body) SetGravityEnabled Uses

func (b Body) SetGravityEnabled(isGravityEnabled bool)

SetGravityEnabled sets whether gravity affects the body.

func (Body) SetGyroModeEnabled Uses

func (b Body) SetGyroModeEnabled(isEnabled bool)

SetGyroModeEnabled sets whether gyroscopic mode is enabled.

func (Body) SetKinematic Uses

func (b Body) SetKinematic(isKinematic bool)

SetKinematic sets whether the body is in kinematic mode.

func (Body) SetLinearDamping Uses

func (b Body) SetLinearDamping(scale float64)

SetLinearDamping sets the linear damping scale.

func (Body) SetLinearDampingThreshold Uses

func (b Body) SetLinearDampingThreshold(threshold float64)

SetLinearDampingThreshold sets the linear damping threshold.

func (Body) SetLinearVelocity Uses

func (b Body) SetLinearVelocity(vel Vector3)

SetLinearVelocity sets the linear velocity.

func (Body) SetMass Uses

func (b Body) SetMass(mass *Mass)

SetMass sets the mass.

func (Body) SetMaxAngularSpeed Uses

func (b Body) SetMaxAngularSpeed(maxSpeed float64)

SetMaxAngularSpeed sets the maximum angular speed.

func (Body) SetMovedCallback Uses

func (b Body) SetMovedCallback(cb MovedCallback)

SetMovedCallback sets callback to call when the body has moved.

func (Body) SetPosition Uses

func (b Body) SetPosition(pos Vector3)

SetPosition sets the position.

func (Body) SetQuaternion Uses

func (b Body) SetQuaternion(quat Quaternion)

SetQuaternion sets the orientation represented by a quaternion.

func (Body) SetRotation Uses

func (b Body) SetRotation(rot Matrix3)

SetRotation sets the orientation represented by a rotation matrix.

func (Body) SetTorque Uses

func (b Body) SetTorque(torque Vector3)

SetTorque sets the torque acting on the center of mass.

func (Body) Torque Uses

func (b Body) Torque() Vector3

Torque returns the torque acting on the center of mass.

func (Body) VectorFromWorld Uses

func (b Body) VectorFromWorld(wld Vector3) Vector3

VectorFromWorld converts a vector in world coordinates to body coordinates.

func (Body) VectorToWorld Uses

func (b Body) VectorToWorld(vec Vector3) Vector3

VectorToWorld converts a vector in body coordinates to world coordinates.

func (Body) World Uses

func (b Body) World() World

World returns the world which contains the body.

type Box Uses

type Box struct {
    GeomBase
}

Box is a geometry representing a rectangular box.

func (Box) Lengths Uses

func (b Box) Lengths() Vector3

Lengths returns the lengths of the sides.

func (Box) PointDepth Uses

func (b Box) PointDepth(pt Vector3) float64

PointDepth returns the depth of the given point.

func (Box) SetLengths Uses

func (b Box) SetLengths(lens Vector3)

SetLengths sets the lengths of the sides.

type Capsule Uses

type Capsule struct {
    GeomBase
}

Capsule is a geometry that represents a capsule (a cylinder with a half sphere on each end).

func (Capsule) Params Uses

func (c Capsule) Params() (float64, float64)

Params returns the radius and length.

func (Capsule) PointDepth Uses

func (c Capsule) PointDepth(pt Vector3) float64

PointDepth returns the depth of the given point.

func (Capsule) SetParams Uses

func (c Capsule) SetParams(radius, length float64)

SetParams sets the radius and length.

type Contact Uses

type Contact struct {
    Surface SurfaceParameters
    Geom    ContactGeom
    FDir1   Vector3
}

Contact represents a contact.

func NewContact Uses

func NewContact() *Contact

NewContact returns a new Contact.

type ContactGeom Uses

type ContactGeom struct {
    Pos    Vector3
    Normal Vector3
    Depth  float64
    G1     Geom
    G2     Geom
    Side1  int
    Side2  int
}

ContactGeom represents a contact point.

func NewContactGeom Uses

func NewContactGeom() *ContactGeom

NewContactGeom returns a new ContactGeom.

type ContactJoint Uses

type ContactJoint struct {
    JointBase
}

ContactJoint represents a contact joint.

type Convex Uses

type Convex struct {
    GeomBase
}

Convex is a geometry representing a convex object.

func (Convex) Set Uses

func (c Convex) Set(planes PlaneList, pts VertexList, polyList PolygonList)

Set sets convex object data

type Cylinder Uses

type Cylinder struct {
    GeomBase
}

Cylinder is a geometry that represents a cylider.

func (Cylinder) Params Uses

func (c Cylinder) Params() (float64, float64)

Params returns the radius and length.

func (Cylinder) SetParams Uses

func (c Cylinder) SetParams(radius, length float64)

SetParams sets the radius and length.

type DBallJoint Uses

type DBallJoint struct {
    JointBase
}

DBallJoint represents a double ball joint.

func (DBallJoint) Anchor1 Uses

func (j DBallJoint) Anchor1() Vector3

Anchor1 returns the anchor point for the first body.

func (DBallJoint) Anchor2 Uses

func (j DBallJoint) Anchor2() Vector3

Anchor2 returns the anchor point for the second body.

func (DBallJoint) Distance Uses

func (j DBallJoint) Distance() float64

Distance returns the joint distance.

func (DBallJoint) Param Uses

func (j DBallJoint) Param(parameter int) float64

Param returns a joint parameter.

func (DBallJoint) SetAnchor1 Uses

func (j DBallJoint) SetAnchor1(pt Vector3)

SetAnchor1 sets the anchor point for the first body.

func (DBallJoint) SetAnchor2 Uses

func (j DBallJoint) SetAnchor2(pt Vector3)

SetAnchor2 sets the anchor point for the second body.

func (DBallJoint) SetParam Uses

func (j DBallJoint) SetParam(parameter int, value float64)

SetParam sets a joint parameter.

type DHingeJoint Uses

type DHingeJoint struct {
    JointBase
}

DHingeJoint represents a double hinge joint.

func (DHingeJoint) Anchor1 Uses

func (j DHingeJoint) Anchor1() Vector3

Anchor1 returns the anchor point for the first body.

func (DHingeJoint) Anchor2 Uses

func (j DHingeJoint) Anchor2() Vector3

Anchor2 returns the anchor point for the second body.

func (DHingeJoint) Axis Uses

func (j DHingeJoint) Axis() Vector3

Axis returns the joint axis.

func (DHingeJoint) Distance Uses

func (j DHingeJoint) Distance() float64

Distance returns the joint distance.

func (DHingeJoint) Param Uses

func (j DHingeJoint) Param(parameter int) float64

Param returns a joint parameter.

func (DHingeJoint) SetAnchor1 Uses

func (j DHingeJoint) SetAnchor1(pt Vector3)

SetAnchor1 sets the anchor point for the first body.

func (DHingeJoint) SetAnchor2 Uses

func (j DHingeJoint) SetAnchor2(pt Vector3)

SetAnchor2 sets the anchor point for the second body.

func (DHingeJoint) SetAxis Uses

func (j DHingeJoint) SetAxis(axis Vector3)

SetAxis sets the joint axis.

func (DHingeJoint) SetParam Uses

func (j DHingeJoint) SetParam(parameter int, value float64)

SetParam sets a joint parameter.

type FixedJoint Uses

type FixedJoint struct {
    JointBase
}

FixedJoint represents a fixed joint.

func (FixedJoint) Fix Uses

func (j FixedJoint) Fix()

Fix fixes the joint in its current state.

func (FixedJoint) Param Uses

func (j FixedJoint) Param(parameter int) float64

Param returns a joint parameter.

func (FixedJoint) SetParam Uses

func (j FixedJoint) SetParam(parameter int, value float64)

SetParam sets a joint parameter.

type Geom Uses

type Geom interface {
    Destroy()
    SetData(data interface{})
    Data() interface{}
    SetBody(body Body)
    Body() Body
    SetPosition(pos Vector3)
    Position() Vector3
    SetRotation(rot Matrix3)
    Rotation() Matrix3
    SetQuaternion(quat Quaternion)
    Quaternion() Quaternion
    AABB() AABB
    IsSpace() bool
    Space() Space
    Class() int
    SetCategoryBits(bits int)
    SetCollideBits(bits int)
    CategoryBits() int
    CollideBits() int
    SetEnabled(isEnabled bool)
    Enabled() bool
    RelPointPos(pt Vector3) Vector3
    PosRelPoint(pos Vector3) Vector3
    VectorToWorld(vec Vector3) Vector3
    VectorFromWorld(wld Vector3) Vector3
    OffsetPosition() Vector3
    SetOffsetPosition(pos Vector3)
    OffsetRotation() Matrix3
    SetOffsetRotation(rot Matrix3)
    OffsetQuaternion() Quaternion
    SetOffsetQuaternion(quat Quaternion)
    SetOffsetWorldPosition(pos Vector3)
    SetOffsetWorldRotation(rot Matrix3)
    SetOffsetWorldQuaternion(quat Quaternion)
    ClearOffset()
    IsOffset() bool
    Collide(other Geom, maxContacts uint16, flags int) []ContactGeom
    Collide2(other Geom, data interface{}, cb NearCallback)
    Next() Geom
    // contains filtered or unexported methods
}

Geom represents rigid body geometry.

type GeomBase Uses

type GeomBase uintptr

GeomBase implements Geom, and is embedded by specific Geom types.

func (GeomBase) AABB Uses

func (g GeomBase) AABB() AABB

AABB returns the axis-aligned bounding box.

func (GeomBase) Body Uses

func (g GeomBase) Body() Body

Body returns the body associated with the geometry.

func (GeomBase) CategoryBits Uses

func (g GeomBase) CategoryBits() int

CategoryBits returns the category bitfield.

func (GeomBase) Class Uses

func (g GeomBase) Class() int

Class returns the geometry class.

func (GeomBase) ClearOffset Uses

func (g GeomBase) ClearOffset()

ClearOffset removes the body offset.

func (GeomBase) Collide Uses

func (g GeomBase) Collide(other Geom, maxContacts uint16, flags int) []ContactGeom

Collide tests for collision with the given geometry and returns a list of contact points.

func (GeomBase) Collide2 Uses

func (g GeomBase) Collide2(other Geom, data interface{}, cb NearCallback)

Collide2 tests for collision with the given geometry, applying cb for each contact.

func (GeomBase) CollideBits Uses

func (g GeomBase) CollideBits() int

CollideBits returns the collide bitfield.

func (GeomBase) Data Uses

func (g GeomBase) Data() interface{}

Data returns the user-specified data associated with the geometry.

func (GeomBase) Destroy Uses

func (g GeomBase) Destroy()

Destroy destroys the GeomBase.

func (GeomBase) Enabled Uses

func (g GeomBase) Enabled() bool

Enabled returns whether the geometry is enabled.

func (GeomBase) IsOffset Uses

func (g GeomBase) IsOffset() bool

IsOffset returns whether a body offset has been created.

func (GeomBase) IsSpace Uses

func (g GeomBase) IsSpace() bool

IsSpace returns whether the geometry is a space.

func (GeomBase) Next Uses

func (g GeomBase) Next() Geom

Next returns the next geometry.

func (GeomBase) OffsetPosition Uses

func (g GeomBase) OffsetPosition() Vector3

OffsetPosition returns the position offset from the body.

func (GeomBase) OffsetQuaternion Uses

func (g GeomBase) OffsetQuaternion() Quaternion

OffsetQuaternion returns the orientation offset from the body represented by a quaternion.

func (GeomBase) OffsetRotation Uses

func (g GeomBase) OffsetRotation() Matrix3

OffsetRotation returns the orientation offset from the body represented by a rotation matrix.

func (GeomBase) PosRelPoint Uses

func (g GeomBase) PosRelPoint(pos Vector3) Vector3

PosRelPoint returns the position in geometry coordinates of a point in world coordinates.

func (GeomBase) Position Uses

func (g GeomBase) Position() Vector3

Position returns the position.

func (GeomBase) Quaternion Uses

func (g GeomBase) Quaternion() Quaternion

Quaternion returns the orientation represented by a quaternion.

func (GeomBase) RelPointPos Uses

func (g GeomBase) RelPointPos(pt Vector3) Vector3

RelPointPos returns the position in world coordinates of a point in geometry coordinates.

func (GeomBase) Rotation Uses

func (g GeomBase) Rotation() Matrix3

Rotation returns the orientation represented by a rotation matrix.

func (GeomBase) SetBody Uses

func (g GeomBase) SetBody(body Body)

SetBody sets the associated body.

func (GeomBase) SetCategoryBits Uses

func (g GeomBase) SetCategoryBits(bits int)

SetCategoryBits sets the category bitfield.

func (GeomBase) SetCollideBits Uses

func (g GeomBase) SetCollideBits(bits int)

SetCollideBits sets the collide bitfield.

func (GeomBase) SetData Uses

func (g GeomBase) SetData(data interface{})

SetData associates user-specified data with the geometry.

func (GeomBase) SetEnabled Uses

func (g GeomBase) SetEnabled(isEnabled bool)

SetEnabled sets whether the geometry is enabled.

func (GeomBase) SetOffsetPosition Uses

func (g GeomBase) SetOffsetPosition(pos Vector3)

SetOffsetPosition sets the position offset from the body.

func (GeomBase) SetOffsetQuaternion Uses

func (g GeomBase) SetOffsetQuaternion(quat Quaternion)

SetOffsetQuaternion sets the offset from the body orientation represented by a quaternion.

func (GeomBase) SetOffsetRotation Uses

func (g GeomBase) SetOffsetRotation(rot Matrix3)

SetOffsetRotation sets the orientation offset from the body represented by a rotation matrix.

func (GeomBase) SetOffsetWorldPosition Uses

func (g GeomBase) SetOffsetWorldPosition(pos Vector3)

SetOffsetWorldPosition sets the offset to the body position such that the geom's world position is pos.

func (GeomBase) SetOffsetWorldQuaternion Uses

func (g GeomBase) SetOffsetWorldQuaternion(quat Quaternion)

SetOffsetWorldQuaternion sets the offset to the body orientation such that the geom's world orientation is represented by the quaternion quat.

func (GeomBase) SetOffsetWorldRotation Uses

func (g GeomBase) SetOffsetWorldRotation(rot Matrix3)

SetOffsetWorldRotation sets the offset to the body orientation such that the geom's world orientation is represented by the matrix rot.

func (GeomBase) SetPosition Uses

func (g GeomBase) SetPosition(pos Vector3)

SetPosition sets the position.

func (GeomBase) SetQuaternion Uses

func (g GeomBase) SetQuaternion(quat Quaternion)

SetQuaternion sets the orientation represented by a quaternion.

func (GeomBase) SetRotation Uses

func (g GeomBase) SetRotation(rot Matrix3)

SetRotation sets the orientation represented by a rotation matrix.

func (GeomBase) Space Uses

func (g GeomBase) Space() Space

Space returns the containing space.

func (GeomBase) VectorFromWorld Uses

func (g GeomBase) VectorFromWorld(wld Vector3) Vector3

VectorFromWorld converts a vector in world coordinates to geometry coordinates.

func (GeomBase) VectorToWorld Uses

func (g GeomBase) VectorToWorld(vec Vector3) Vector3

VectorToWorld converts a vector in geometry coordinates to world coordinates.

type HashSpace Uses

type HashSpace struct {
    SpaceBase
}

HashSpace represents a hash space.

func (HashSpace) Levels Uses

func (s HashSpace) Levels() (int, int)

Levels returns the minimum and maximum levels.

func (HashSpace) SetLevels Uses

func (s HashSpace) SetLevels(min, max int)

SetLevels sets the minimum and maximum levels.

type Heightfield Uses

type Heightfield struct {
    GeomBase
}

Heightfield is a geometry representing a heightfield.

func (Heightfield) Build Uses

func (h Heightfield) Build(data HeightfieldData, heightSamples Matrix,
    width, depth, scale, offset, thickness float64, doWrap bool)

Build builds a heightfield data set.

func (Heightfield) HeightfieldData Uses

func (h Heightfield) HeightfieldData() HeightfieldData

HeightfieldData returns the data set associated with the heightfield.

func (Heightfield) SetBounds Uses

func (h Heightfield) SetBounds(data HeightfieldData, minHeight, maxHeight float64)

SetBounds sets the minimum and maximum height.

func (Heightfield) SetHeightfieldData Uses

func (h Heightfield) SetHeightfieldData(data HeightfieldData)

SetHeightfieldData associates a data set to the heightfield.

type HeightfieldData Uses

type HeightfieldData uintptr

HeightfieldData represents heightfield data.

func NewHeightfieldData Uses

func NewHeightfieldData() HeightfieldData

NewHeightfieldData returns a new HeightfieldData instance.

func (*HeightfieldData) Destroy Uses

func (h *HeightfieldData) Destroy()

Destroy destroys the heightfield data.

type Hinge2Joint Uses

type Hinge2Joint struct {
    JointBase
}

Hinge2Joint represents two hinge joints in series.

func (Hinge2Joint) AddTorques Uses

func (j Hinge2Joint) AddTorques(torque1, torque2 float64)

AddTorques adds torques to the joint.

func (Hinge2Joint) Anchor Uses

func (j Hinge2Joint) Anchor() Vector3

Anchor returns the anchor point for the first body.

func (Hinge2Joint) Anchor2 Uses

func (j Hinge2Joint) Anchor2() Vector3

Anchor2 returns the anchor point for the second body.

func (Hinge2Joint) Angle1 Uses

func (j Hinge2Joint) Angle1() float64

Angle1 returns the first angle.

func (Hinge2Joint) Angle1Rate Uses

func (j Hinge2Joint) Angle1Rate() float64

Angle1Rate returns the first angle's rate of change.

func (Hinge2Joint) Angle2 Uses

func (j Hinge2Joint) Angle2() float64

Angle2 returns the second angle.

func (Hinge2Joint) Angle2Rate Uses

func (j Hinge2Joint) Angle2Rate() float64

Angle2Rate returns the second angle's rate of change.

func (Hinge2Joint) Axis1 Uses

func (j Hinge2Joint) Axis1() Vector3

Axis1 returns the first axis.

func (Hinge2Joint) Axis2 Uses

func (j Hinge2Joint) Axis2() Vector3

Axis2 returns the second axis.

func (Hinge2Joint) Param Uses

func (j Hinge2Joint) Param(parameter int) float64

Param returns a joint parameter.

func (Hinge2Joint) SetAnchor Uses

func (j Hinge2Joint) SetAnchor(pt Vector3)

SetAnchor sets the anchor point.

func (Hinge2Joint) SetAxis1 Uses

func (j Hinge2Joint) SetAxis1(axis Vector3)

SetAxis1 sets the first axis.

func (Hinge2Joint) SetAxis2 Uses

func (j Hinge2Joint) SetAxis2(axis Vector3)

SetAxis2 sets the second axis.

func (Hinge2Joint) SetParam Uses

func (j Hinge2Joint) SetParam(parameter int, value float64)

SetParam sets a joint parameter.

type HingeJoint Uses

type HingeJoint struct {
    JointBase
}

HingeJoint represents a hinge joint.

func (HingeJoint) AddTorque Uses

func (j HingeJoint) AddTorque(torque float64)

AddTorque adds a torque to the joint.

func (HingeJoint) Anchor Uses

func (j HingeJoint) Anchor() Vector3

Anchor returns the anchor point for the first body.

func (HingeJoint) Anchor2 Uses

func (j HingeJoint) Anchor2() Vector3

Anchor2 returns the anchor point for the second body.

func (HingeJoint) Angle Uses

func (j HingeJoint) Angle() float64

Angle returns the joint angle.

func (HingeJoint) AngleRate Uses

func (j HingeJoint) AngleRate() float64

AngleRate returns the joint angle's rate of change.

func (HingeJoint) Axis Uses

func (j HingeJoint) Axis() Vector3

Axis returns the hinge axis.

func (HingeJoint) Param Uses

func (j HingeJoint) Param(parameter int) float64

Param returns a joint parameter.

func (HingeJoint) SetAnchor Uses

func (j HingeJoint) SetAnchor(pt Vector3)

SetAnchor sets the anchor point.

func (HingeJoint) SetAnchorDelta Uses

func (j HingeJoint) SetAnchorDelta(pt, delta Vector3)

SetAnchorDelta sets the hinge anchor delta.

func (HingeJoint) SetAxis Uses

func (j HingeJoint) SetAxis(axis Vector3)

SetAxis sets the hinge axis.

func (HingeJoint) SetAxisOffset Uses

func (j HingeJoint) SetAxisOffset(axis Vector3, angle float64)

SetAxisOffset set the hinge axis as if the 2 bodies were already at angle appart.

func (HingeJoint) SetParam Uses

func (j HingeJoint) SetParam(parameter int, value float64)

SetParam sets a joint parameter.

type Joint Uses

type Joint interface {
    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
    // contains filtered or unexported methods
}

Joint represents a joint.

type JointBase Uses

type JointBase uintptr

JointBase implements Joint, and is embedded by specific Joint types.

func (JointBase) Attach Uses

func (j JointBase) Attach(body1, body2 Body)

Attach attaches two bodies with the joint.

func (JointBase) Body Uses

func (j JointBase) Body(index int) Body

Body returns the attached body, specified by index.

func (JointBase) Data Uses

func (j JointBase) Data() interface{}

Data returns the user-specified data associated with the joint.

func (JointBase) Destroy Uses

func (j JointBase) Destroy()

Destroy destroys the joint base.

func (JointBase) Enabled Uses

func (j JointBase) Enabled() bool

Enabled returns whether the joint is enabled.

func (JointBase) Feedback Uses

func (j JointBase) Feedback() *JointFeedback

Feedback returns the feedback forces and torques.

func (JointBase) NumBodies Uses

func (j JointBase) NumBodies() int

NumBodies returns the number of attached bodies.

func (JointBase) SetData Uses

func (j JointBase) SetData(data interface{})

SetData associates user-specified data with the joint.

func (JointBase) SetEnabled Uses

func (j JointBase) SetEnabled(isEnabled bool)

SetEnabled sets whether the joint is enabled.

func (JointBase) SetFeedback Uses

func (j JointBase) SetFeedback(f *JointFeedback)

SetFeedback sets the feedback forces and torques.

func (JointBase) Type Uses

func (j JointBase) Type() int

Type returns the joint type.

type JointFeedback Uses

type JointFeedback struct {
    Force1  Vector3 // force applied to body 1
    Torque1 Vector3 // torque applied to body 1
    Force2  Vector3 // force applied to body 2
    Torque2 Vector3 // torque applied to body 2
}

JointFeedback represents feedback forces and torques associated with a joint.

type JointGroup Uses

type JointGroup uintptr

JointGroup represents a group of joints.

func NewJointGroup Uses

func NewJointGroup(maxJoints int) JointGroup

NewJointGroup returns a new JointGroup instance.

func (JointGroup) Destroy Uses

func (g JointGroup) Destroy()

Destroy destroys the joint group.

func (JointGroup) Empty Uses

func (g JointGroup) Empty()

Empty removes all joints from the group.

type LMotorJoint Uses

type LMotorJoint struct {
    JointBase
}

LMotorJoint represents a linear motor joint.

func (LMotorJoint) Axis Uses

func (j LMotorJoint) Axis(num int) Vector3

Axis returns the given axis.

func (LMotorJoint) NumAxes Uses

func (j LMotorJoint) NumAxes() int

NumAxes returns the number of axes.

func (LMotorJoint) Param Uses

func (j LMotorJoint) Param(parameter int) float64

Param returns a joint parameter.

func (LMotorJoint) SetAxis Uses

func (j LMotorJoint) SetAxis(num, rel int, axis Vector3)

SetAxis sets the given axis relative to a body (1 or 2) or none (0).

func (LMotorJoint) SetNumAxes Uses

func (j LMotorJoint) SetNumAxes(num int)

SetNumAxes sets the number of axes.

func (LMotorJoint) SetParam Uses

func (j LMotorJoint) SetParam(parameter int, value float64)

SetParam sets a joint parameter.

type Mass Uses

type Mass struct {
    Center  Vector3
    Inertia Matrix3
    Mass    float64
}

Mass represents object mass properties.

func NewMass Uses

func NewMass() *Mass

NewMass returns a new Mass instance.

func (*Mass) Add Uses

func (m *Mass) Add(other *Mass)

Add adds the other mass to this mass.

func (*Mass) Adjust Uses

func (m *Mass) Adjust(mass float64)

Adjust sets parameters based on the given total mass.

func (*Mass) Check Uses

func (m *Mass) Check() bool

Check returns whether the mass's parameter values are valid.

func (*Mass) Rotate Uses

func (m *Mass) Rotate(rot Matrix3)

Rotate rotates the mass by rot.

func (*Mass) SetBox Uses

func (m *Mass) SetBox(density float64, lens Vector3)

SetBox sets the mass for a box of given properties.

func (*Mass) SetBoxTotal Uses

func (m *Mass) SetBoxTotal(totalMass float64, lens Vector3)

SetBoxTotal sets the mass for a box of given properties.

func (*Mass) SetCapsule Uses

func (m *Mass) SetCapsule(density float64, direction int, radius, length float64)

SetCapsule sets the mass for a capsule of given properties.

func (*Mass) SetCapsuleTotal Uses

func (m *Mass) SetCapsuleTotal(totalMass float64, direction int, radius, length float64)

SetCapsuleTotal sets the mass for a capsule of given properties.

func (*Mass) SetCylinder Uses

func (m *Mass) SetCylinder(density float64, direction int, radius, length float64)

SetCylinder sets the mass for a cylinder of given properties.

func (*Mass) SetCylinderTotal Uses

func (m *Mass) SetCylinderTotal(totalMass float64, direction int, radius, length float64)

SetCylinderTotal sets the mass for a cylinder of given properties.

func (*Mass) SetParams Uses

func (m *Mass) SetParams(mass float64, com Vector3, inert Matrix3)

SetParams sets the mass parameters.

func (*Mass) SetSphere Uses

func (m *Mass) SetSphere(density, radius float64)

SetSphere sets the mass for a sphere of given properties.

func (*Mass) SetSphereTotal Uses

func (m *Mass) SetSphereTotal(totalMass, radius float64)

SetSphereTotal sets the mass for a sphere of given properties.

func (*Mass) SetTriMesh Uses

func (m *Mass) SetTriMesh(density float64, mesh TriMesh)

SetTrimesh sets the mass for the given triangle mesh.

func (*Mass) SetTriMeshTotal Uses

func (m *Mass) SetTriMeshTotal(totalMass float64, mesh TriMesh)

SetTrimeshTotal sets the mass for the given triangle mesh.

func (*Mass) SetZero Uses

func (m *Mass) SetZero()

SetZero sets the mass to 0.

func (*Mass) Translate Uses

func (m *Mass) Translate(vec Vector3)

Translate translates the mass by vec.

type Matrix Uses

type Matrix [][]float64

Matrix represents a double precision matrix.

func NewMatrix Uses

func NewMatrix(numRows, numCols, align int, vals ...float64) Matrix

NewVector returns a new Matrix instance.

type Matrix3 Uses

type Matrix3 Matrix

Matrix3 represents a 3x3 matrix.

func NewMatrix3 Uses

func NewMatrix3(vals ...float64) Matrix3

NewMatrix3 returns a new Matrix3 instance.

type Matrix4 Uses

type Matrix4 Matrix

Matrix4 represents a 4x4 matrix.

func NewMatrix4 Uses

func NewMatrix4(vals ...float64) Matrix4

NewMatrix4 returns a new Matrix4 instance.

type MovedCallback Uses

type MovedCallback func(b Body)

MovedCallback is called when the body has moved.

type NearCallback Uses

type NearCallback func(data interface{}, obj1, obj2 Geom)

NearCallback is a callback type for handling potential object collisions.

type NullJoint Uses

type NullJoint struct {
    JointBase
}

NullJoint represents a null joint.

type PRJoint Uses

type PRJoint struct {
    JointBase
}

PRJoint represents a prismatic rotoide joint.

func (PRJoint) AddTorque Uses

func (j PRJoint) AddTorque(torque float64)

AddTorque adds a torque to the joint.

func (PRJoint) Anchor Uses

func (j PRJoint) Anchor() Vector3

Anchor returns the anchor point.

func (PRJoint) Angle Uses

func (j PRJoint) Angle() float64

Angle returns the joint angle.

func (PRJoint) AngleRate Uses

func (j PRJoint) AngleRate() float64

AngleRate returns the joint angle's rate of change.

func (PRJoint) Axis1 Uses

func (j PRJoint) Axis1() Vector3

Axis1 returns the first axis.

func (PRJoint) Axis2 Uses

func (j PRJoint) Axis2() Vector3

Axis2 returns the second axis.

func (PRJoint) Param Uses

func (j PRJoint) Param(parameter int) float64

Param returns a joint parameter.

func (PRJoint) Position Uses

func (j PRJoint) Position() float64

Position returns the slider position.

func (PRJoint) PositionRate Uses

func (j PRJoint) PositionRate() float64

PositionRate returns the slider position's rate of change.

func (PRJoint) SetAnchor Uses

func (j PRJoint) SetAnchor(pt Vector3)

SetAnchor sets the anchor point.

func (PRJoint) SetAxis1 Uses

func (j PRJoint) SetAxis1(axis Vector3)

SetAxis1 sets the first axis.

func (PRJoint) SetAxis2 Uses

func (j PRJoint) SetAxis2(axis Vector3)

SetAxis2 sets the second axis.

func (PRJoint) SetParam Uses

func (j PRJoint) SetParam(parameter int, value float64)

SetParam sets a joint parameter.

type PUJoint Uses

type PUJoint struct {
    JointBase
}

PUJoint represents a prismatic universal joint.

func (PUJoint) Anchor Uses

func (j PUJoint) Anchor() Vector3

Anchor returns the anchor point.

func (PUJoint) Angle1 Uses

func (j PUJoint) Angle1() float64

Angle1 returns the first angle.

func (PUJoint) Angle1Rate Uses

func (j PUJoint) Angle1Rate() float64

Angle1Rate returns the first angle's rate of change.

func (PUJoint) Angle2 Uses

func (j PUJoint) Angle2() float64

Angle2 returns the second angle.

func (PUJoint) Angle2Rate Uses

func (j PUJoint) Angle2Rate() float64

Angle2Rate returns the second angle's rate of change.

func (PUJoint) Angles Uses

func (j PUJoint) Angles() (float64, float64)

Angles returns the two joint angles.

func (PUJoint) Axis1 Uses

func (j PUJoint) Axis1() Vector3

Axis1 returns the first axis.

func (PUJoint) Axis2 Uses

func (j PUJoint) Axis2() Vector3

Axis2 returns the second axis.

func (PUJoint) Axis3 Uses

func (j PUJoint) Axis3() Vector3

Axis3 returns the third (prismatic) axis.

func (PUJoint) Param Uses

func (j PUJoint) Param(parameter int) float64

Param returns a joint parameter.

func (PUJoint) Position Uses

func (j PUJoint) Position() float64

Position returns the joint position.

func (PUJoint) PositionRate Uses

func (j PUJoint) PositionRate() float64

PositionRate returns the joint position's rate of change.

func (PUJoint) SetAnchor Uses

func (j PUJoint) SetAnchor(pt Vector3)

SetAnchor sets the anchor point.

func (PUJoint) SetAnchorOffset Uses

func (j PUJoint) SetAnchorOffset(pt, delta Vector3)

SetAnchorOffset sets the anchor as if the 2 bodies were already delta appart.

func (PUJoint) SetAxis1 Uses

func (j PUJoint) SetAxis1(axis Vector3)

SetAxis1 sets the first axis.

func (PUJoint) SetAxis2 Uses

func (j PUJoint) SetAxis2(axis Vector3)

SetAxis2 sets the second axis.

func (PUJoint) SetAxis3 Uses

func (j PUJoint) SetAxis3(axis Vector3)

SetAxis3 sets the third (prismatic) axis.

func (PUJoint) SetParam Uses

func (j PUJoint) SetParam(parameter int, value float64)

SetParam sets a joint parameter.

type PistonJoint Uses

type PistonJoint struct {
    JointBase
}

PistonJoint represents a piston joint.

func (PistonJoint) AddForce Uses

func (j PistonJoint) AddForce(force float64)

AddForce adds a force to the joint.

func (PistonJoint) Anchor2 Uses

func (j PistonJoint) Anchor2() Vector3

Anchor2 returns the anchor point for the second body.

func (PistonJoint) Angle Uses

func (j PistonJoint) Angle() float64

Angle returns the joint angle.

func (PistonJoint) AngleRate Uses

func (j PistonJoint) AngleRate() float64

AngleRate returns the joint angle's rate of change.

func (PistonJoint) Axis Uses

func (j PistonJoint) Axis() Vector3

Axis returns the piston axis.

func (PistonJoint) Param Uses

func (j PistonJoint) Param(parameter int) float64

Param returns a joint parameter.

func (PistonJoint) Position Uses

func (j PistonJoint) Position() float64

Position returns the piston position.

func (PistonJoint) PositionRate Uses

func (j PistonJoint) PositionRate() float64

PositionRate returns the piston position's rate of change.

func (PistonJoint) SetAnchor Uses

func (j PistonJoint) SetAnchor(pt Vector3)

SetAnchor sets the anchor point.

func (PistonJoint) SetAnchorOffset Uses

func (j PistonJoint) SetAnchorOffset(pt, delta Vector3)

SetAnchorOffset sets the anchor as if the 2 bodies were already delta appart.

func (PistonJoint) SetAxis Uses

func (j PistonJoint) SetAxis(axis Vector3)

SetAxis sets the piston axis.

func (PistonJoint) SetParam Uses

func (j PistonJoint) SetParam(parameter int, value float64)

SetParam sets a joint parameter.

type Plane Uses

type Plane struct {
    GeomBase
}

Plane is a geometry that represents a plane.

func (Plane) Params Uses

func (p Plane) Params() Vector4

Params returns plane parameters.

func (Plane) PointDepth Uses

func (p Plane) PointDepth(pt Vector3) float64

PointDepth returns the depth of the given point.

func (Plane) SetParams Uses

func (p Plane) SetParams(params Vector4)

SetParams sets plane parameters.

type Plane2DJoint Uses

type Plane2DJoint struct {
    JointBase
}

Plane2DJoint represents a plane joint.

func (Plane2DJoint) SetAngleParam Uses

func (j Plane2DJoint) SetAngleParam(parameter int, value float64)

SetAngleParam sets a joint parameter.

func (Plane2DJoint) SetXParam Uses

func (j Plane2DJoint) SetXParam(parameter int, value float64)

SetXParam sets a joint parameter.

func (Plane2DJoint) SetYParam Uses

func (j Plane2DJoint) SetYParam(parameter int, value float64)

SetYParam sets a joint parameter.

type PlaneList Uses

type PlaneList Matrix

PlaneList represents a list of plane definitions.

func NewPlaneList Uses

func NewPlaneList(size int, vals ...float64) PlaneList

NewPlaneList returns a new PlaneList instance.

type PolygonList Uses

type PolygonList []C.uint

PolygonList represents a list of polygon definitions

type QuadTreeSpace Uses

type QuadTreeSpace struct {
    SpaceBase
}

QuadTreeSpace represents a quad tree space.

type Quaternion Uses

type Quaternion Vector

Quaternion represents a quaternion.

func NewQuaternion Uses

func NewQuaternion(vals ...float64) Quaternion

NewQuaternion returns a new Quaternion instance.

type Ray Uses

type Ray struct {
    GeomBase
}

Ray is a geometry representing a ray.

func (Ray) BackfaceCull Uses

func (r Ray) BackfaceCull() bool

BackfaceCull returns whether backface culling is enabled.

func (Ray) ClosestHit Uses

func (r Ray) ClosestHit() bool

ClosestHit returns whether only the closest hit will be reported.

func (Ray) FirstContact Uses

func (r Ray) FirstContact() bool

FirstContact returns whether collision detection will stop after finding the first contact.

func (Ray) Length Uses

func (r Ray) Length() float64

Length returns the length.

func (Ray) PosDir Uses

func (r Ray) PosDir() (Vector3, Vector3)

PosDir returns the position and direction.

func (Ray) SetBackfaceCull Uses

func (r Ray) SetBackfaceCull(backfaceCull bool)

SetBackfaceCull sets whether backface culling is enabled.

func (Ray) SetClosestHit Uses

func (r Ray) SetClosestHit(closestHit bool)

SetClosestHit sets whether to only report the closest hit.

func (Ray) SetFirstContact Uses

func (r Ray) SetFirstContact(firstContact bool)

SetFirstContact sets whether to stop collision detection after finding the first contact point.

func (Ray) SetLength Uses

func (r Ray) SetLength(length float64)

SetLength sets the length.

func (Ray) SetPosDir Uses

func (r Ray) SetPosDir(pos, dir Vector3)

SetPosDir sets the position and direction.

type SimpleSpace Uses

type SimpleSpace struct {
    SpaceBase
}

SimpleSpace represents a simple space.

type SliderJoint Uses

type SliderJoint struct {
    JointBase
}

SliderJoint represents a slider joints.

func (SliderJoint) AddForce Uses

func (j SliderJoint) AddForce(force float64)

AddForce adds a force to the joint.

func (SliderJoint) Axis Uses

func (j SliderJoint) Axis() Vector3

Axis returns the slider axis.

func (SliderJoint) Param Uses

func (j SliderJoint) Param(parameter int) float64

Param returns a joint parameter.

func (SliderJoint) Position Uses

func (j SliderJoint) Position() float64

Position returns the slider position.

func (SliderJoint) PositionRate Uses

func (j SliderJoint) PositionRate() float64

PositionRate returns the slider position's rate of change.

func (SliderJoint) SetAxis Uses

func (j SliderJoint) SetAxis(axis Vector3)

SetAxis sets the slider axis.

func (SliderJoint) SetAxisDelta Uses

func (j SliderJoint) SetAxisDelta(pt, delta Vector3)

SetAxisDelta sets the slider axis delta.

func (SliderJoint) SetParam Uses

func (j SliderJoint) SetParam(parameter int, value float64)

SetParam sets a joint parameter.

type Space Uses

type Space interface {
    Destroy()
    SetCleanup(mode bool)
    Cleanup() bool
    SetManualCleanup(mode bool)
    SetSublevel(sublevel int)
    Sublevel() int
    ManualCleanup() bool
    Clean()
    Class() int
    Add(g Geom)
    Remove(g Geom)
    Query(g Geom) bool
    NumGeoms(g Geom) int
    Geom(index int) Geom
    Collide(data interface{}, cb NearCallback)
    NewSphere(radius float64) Sphere
    NewBox(lens Vector3) Box
    NewPlane(params Vector4) Plane
    NewCapsule(radius, length float64) Capsule
    NewCylinder(radius, length float64) Cylinder
    NewRay(length float64) Ray
    NewHeightfield(data HeightfieldData, placeable bool) Heightfield
    NewSimpleSpace() SimpleSpace
    NewHashSpace() HashSpace
    NewQuadTreeSpace(center, extents Vector3, depth int) QuadTreeSpace
    NewSweepAndPruneSpace(axisOrder int) SweepAndPruneSpace
    // contains filtered or unexported methods
}

Space represents a space containing bodies.

func NilSpace Uses

func NilSpace() Space

NilSpace returns the top level "0" space

type SpaceBase Uses

type SpaceBase uintptr

SpaceBase implements Space, and is embedded by specific Space types.

func (SpaceBase) Add Uses

func (s SpaceBase) Add(g Geom)

Add adds a geometry to the space.

func (SpaceBase) Class Uses

func (s SpaceBase) Class() int

Class returns the space class.

func (SpaceBase) Clean Uses

func (s SpaceBase) Clean()

Clean cleans the space.

func (SpaceBase) Cleanup Uses

func (s SpaceBase) Cleanup() bool

Cleanup returns whether contained objects will be destroyed.

func (SpaceBase) Collide Uses

func (s SpaceBase) Collide(data interface{}, cb NearCallback)

Collide tests for collision between contained objects.

func (SpaceBase) Destroy Uses

func (s SpaceBase) Destroy()

Destroy destroys the space.

func (SpaceBase) Geom Uses

func (s SpaceBase) Geom(index int) Geom

Geom returns the specified contained geometry.

func (SpaceBase) ManualCleanup Uses

func (s SpaceBase) ManualCleanup() bool

ManualCleanup returns whether this space is marked for manual cleanup.

func (SpaceBase) NewBox Uses

func (s SpaceBase) NewBox(lens Vector3) Box

NewBox returns a new Box instance.

func (SpaceBase) NewCapsule Uses

func (s SpaceBase) NewCapsule(radius, length float64) Capsule

NewCapsule returns a new Capsule instance.

func (SpaceBase) NewConvex Uses

func (s SpaceBase) NewConvex(planes PlaneList, pts VertexList, polyList PolygonList) Convex

NewConvex returns a new Convex instance.

func (SpaceBase) NewCylinder Uses

func (s SpaceBase) NewCylinder(radius, length float64) Cylinder

NewCylinder returns a new Cylinder instance.

func (SpaceBase) NewHashSpace Uses

func (s SpaceBase) NewHashSpace() HashSpace

NewHashSpace returns a new HashSpace instance.

func (SpaceBase) NewHeightfield Uses

func (s SpaceBase) NewHeightfield(data HeightfieldData, placeable bool) Heightfield

NewHeightfield returns a new Heightfield instance.

func (SpaceBase) NewPlane Uses

func (s SpaceBase) NewPlane(params Vector4) Plane

NewPlane returns a new Plane instance.

func (SpaceBase) NewQuadTreeSpace Uses

func (s SpaceBase) NewQuadTreeSpace(center, extents Vector3, depth int) QuadTreeSpace

NewQuadTreeSpace returns a new QuadTreeSpace instance.

func (SpaceBase) NewRay Uses

func (s SpaceBase) NewRay(length float64) Ray

NewRay returns a new Ray instance.

func (SpaceBase) NewSimpleSpace Uses

func (s SpaceBase) NewSimpleSpace() SimpleSpace

NewSimpleSpace returns a new SimpleSpace instance.

func (SpaceBase) NewSphere Uses

func (s SpaceBase) NewSphere(radius float64) Sphere

NewSphere returns a new Sphere instance.

func (SpaceBase) NewSweepAndPruneSpace Uses

func (s SpaceBase) NewSweepAndPruneSpace(axisOrder int) SweepAndPruneSpace

NewSweepAndPruneSpace returns a new SweepAndPruneSpace instance.

func (SpaceBase) NewTriMesh Uses

func (s SpaceBase) NewTriMesh(data TriMeshData) TriMesh

NewTriMesh returns a new TriMesh instance.

func (SpaceBase) NumGeoms Uses

func (s SpaceBase) NumGeoms(g Geom) int

NumGeoms returns the number of geometries contained in the space.

func (SpaceBase) Query Uses

func (s SpaceBase) Query(g Geom) bool

Query returns whether a geometry is contained in the space.

func (SpaceBase) Remove Uses

func (s SpaceBase) Remove(g Geom)

Remove removes a geometry from the space.

func (SpaceBase) SetCleanup Uses

func (s SpaceBase) SetCleanup(mode bool)

SetCleanup sets whether contained objects will be destroyed.

func (SpaceBase) SetManualCleanup Uses

func (s SpaceBase) SetManualCleanup(mode bool)

SetManualCleanup sets whether this space is marked for manual cleanup.

func (SpaceBase) SetSublevel Uses

func (s SpaceBase) SetSublevel(sublevel int)

SetSublevel sets the sublevel for this space.

func (SpaceBase) Sublevel Uses

func (s SpaceBase) Sublevel() int

Sublevel returns the sublevel for this space.

type Sphere Uses

type Sphere struct {
    GeomBase
}

Sphere is a geometry representing a sphere.

func (Sphere) Radius Uses

func (s Sphere) Radius() float64

Radius returns the radius.

func (Sphere) SetRadius Uses

func (s Sphere) SetRadius(radius float64)

SetRadius sets the radius.

func (Sphere) SpherePointDepth Uses

func (s Sphere) SpherePointDepth(pt Vector3) float64

SpherePointDepth returns the depth of the given point.

type SurfaceParameters Uses

type SurfaceParameters struct {
    // must always be defined
    Mode int
    Mu   float64

    // only defined if the corresponding flag is set in mode
    Mu2       float64
    Rho       float64
    Rho2      float64
    RhoN      float64
    Bounce    float64
    BounceVel float64
    SoftErp   float64
    SoftCfm   float64
    Motion1   float64
    Motion2   float64
    MotionN   float64
    Slip1     float64
    Slip2     float64
}

SurfaceParameters represents the parameters of a contact surface.

type SweepAndPruneSpace Uses

type SweepAndPruneSpace struct {
    SpaceBase
}

SweepAndPruneSpace represents a sweep and prune space.

type TransmissionJoint Uses

type TransmissionJoint struct {
    JointBase
}

TransmissionJoint represents a transmission joint.

func (TransmissionJoint) Anchor1 Uses

func (j TransmissionJoint) Anchor1() Vector3

Anchor1 returns the anchor point for the first body.

func (TransmissionJoint) Anchor2 Uses

func (j TransmissionJoint) Anchor2() Vector3

Anchor2 returns the anchor point for the second body.

func (TransmissionJoint) Angle1 Uses

func (j TransmissionJoint) Angle1() float64

Angle1 returns the angle of the first wheel.

func (TransmissionJoint) Angle2 Uses

func (j TransmissionJoint) Angle2() float64

Angle2 returns the angle of the second wheel.

func (TransmissionJoint) Axis Uses

func (j TransmissionJoint) Axis() Vector3

Axis returns the common axis.

func (TransmissionJoint) Axis1 Uses

func (j TransmissionJoint) Axis1() Vector3

Axis1 returns the first axis.

func (TransmissionJoint) Axis2 Uses

func (j TransmissionJoint) Axis2() Vector3

Axis2 returns the second axis.

func (TransmissionJoint) Backlash Uses

func (j TransmissionJoint) Backlash() float64

Backlash returns the backlash (gear tooth play distance).

func (TransmissionJoint) ContactPoint1 Uses

func (j TransmissionJoint) ContactPoint1() Vector3

ContactPoint1 returns the contact point on the first wheel.

func (TransmissionJoint) ContactPoint2 Uses

func (j TransmissionJoint) ContactPoint2() Vector3

ContactPoint2 returns the contact point on the second wheel.

func (TransmissionJoint) Mode Uses

func (j TransmissionJoint) Mode() int

Mode returns the transmission mode.

func (TransmissionJoint) Param Uses

func (j TransmissionJoint) Param(parameter int) float64

Param returns a joint parameter.

func (TransmissionJoint) Radius1 Uses

func (j TransmissionJoint) Radius1() float64

Radius1 returns the radius of the first wheel.

func (TransmissionJoint) Radius2 Uses

func (j TransmissionJoint) Radius2() float64

Radius2 returns the radius of the second wheel.

func (TransmissionJoint) Ratio Uses

func (j TransmissionJoint) Ratio() float64

Ratio returns the gear ratio.

func (TransmissionJoint) SetAnchor1 Uses

func (j TransmissionJoint) SetAnchor1(pt Vector3)

SetAnchor1 sets the anchor point for the first body.

func (TransmissionJoint) SetAnchor2 Uses

func (j TransmissionJoint) SetAnchor2(pt Vector3)

SetAnchor2 sets the anchor point for the second body.

func (TransmissionJoint) SetAxis Uses

func (j TransmissionJoint) SetAxis(axis Vector3)

SetAxis sets the common axis.

func (TransmissionJoint) SetAxis1 Uses

func (j TransmissionJoint) SetAxis1(axis Vector3)

SetAxis1 sets the first axis.

func (TransmissionJoint) SetAxis2 Uses

func (j TransmissionJoint) SetAxis2(axis Vector3)

SetAxis2 sets the second axis.

func (TransmissionJoint) SetBacklash Uses

func (j TransmissionJoint) SetBacklash(backlash float64)

SetBacklash set the backlash (gear tooth play distance).

func (TransmissionJoint) SetMode Uses

func (j TransmissionJoint) SetMode(mode int)

SetMode sets the transmission mode.

func (TransmissionJoint) SetParam Uses

func (j TransmissionJoint) SetParam(parameter int, value float64)

SetParam sets a joint parameter.

func (TransmissionJoint) SetRadius1 Uses

func (j TransmissionJoint) SetRadius1(radius float64)

SetRadius1 sets the radius of the first wheel.

func (TransmissionJoint) SetRadius2 Uses

func (j TransmissionJoint) SetRadius2(radius float64)

SetRadius2 sets the radius of the second wheel.

func (TransmissionJoint) SetRatio Uses

func (j TransmissionJoint) SetRatio(ratio float64)

SetRatio sets the gear ratio.

type TriCallback Uses

type TriCallback func(mesh TriMesh, other Geom, index int) bool

TriCallback is called to determine whether to collide a triangle with another geometry.

type TriMesh Uses

type TriMesh struct {
    GeomBase
}

TriMesh is a geometry representing a triangle mesh.

func (TriMesh) ClearTCCache Uses

func (t TriMesh) ClearTCCache()

ClearTCCache clears the temporal coherence cache.

func (TriMesh) LastTransform Uses

func (t TriMesh) LastTransform() Matrix4

LastTransform returns the last transform.

func (TriMesh) MeshData Uses

func (t TriMesh) MeshData() TriMeshData

MeshData returns the mesh data.

func (TriMesh) Point Uses

func (t TriMesh) Point(index int, u, v float64) Vector3

Point returns a point on the specified triangle at the given barycentric coordinates.

func (TriMesh) SetLastTransform Uses

func (t TriMesh) SetLastTransform(xform Matrix4)

SetLastTransform sets the last transform.

func (TriMesh) SetMeshData Uses

func (t TriMesh) SetMeshData(data TriMeshData)

SetMeshData sets the mesh data.

func (TriMesh) SetTCEnabled Uses

func (t TriMesh) SetTCEnabled(class int, isEnabled bool)

SetTCEnabled sets whether temporal coherence is enabled for the given geometry class.

func (TriMesh) SetTriCallback Uses

func (t TriMesh) SetTriCallback(cb TriCallback)

SetTriCallback sets the triangle collision callback.

func (TriMesh) SetTriRayCallback Uses

func (t TriMesh) SetTriRayCallback(cb TriRayCallback)

SetTriRayCallback sets the triangle/ray collision callback.

func (TriMesh) TCEnabled Uses

func (t TriMesh) TCEnabled(class int) bool

TCEnabled returns whether temporal coherence is enabled for the given geometry class.

func (TriMesh) TriCallback Uses

func (t TriMesh) TriCallback() TriCallback

TriCallback returns the triangle collision callback.

func (TriMesh) TriRayCallback Uses

func (t TriMesh) TriRayCallback() TriRayCallback

TriRayCallback returns the triangle/ray collision callback.

func (TriMesh) Triangle Uses

func (t TriMesh) Triangle(index int) (Vector3, Vector3, Vector3)

Triangle returns a triangle in the mesh by index.

func (TriMesh) TriangleCount Uses

func (t TriMesh) TriangleCount() int

TriangleCount returns the number of triangles in the mesh.

type TriMeshData Uses

type TriMeshData uintptr

TriMeshData represents triangle mesh data.

func NewTriMeshData Uses

func NewTriMeshData() TriMeshData

NewTriMeshData returns a new TriMeshData instance.

func (TriMeshData) Build Uses

func (t TriMeshData) Build(verts VertexList, tris TriVertexIndexList)

Build builds a triangle mesh from the given data.

func (TriMeshData) Destroy Uses

func (t TriMeshData) Destroy()

Destroy destroys the triangle mesh data.

func (TriMeshData) Preprocess Uses

func (t TriMeshData) Preprocess()

Preprocess preprocesses the triangle mesh data.

func (TriMeshData) Update Uses

func (t TriMeshData) Update()

Update updates the triangle mesh data.

type TriRayCallback Uses

type TriRayCallback func(mesh TriMesh, ray Ray, index int, u, v float64) bool

TriRayCallback is called to determine whether to collide a triangle with a ray at a given point.

type TriVertexIndexList Uses

type TriVertexIndexList [][]uint32

TriVertexIndexList represents a list of triangle vertex indices.

func NewTriVertexIndexList Uses

func NewTriVertexIndexList(size int, indices ...uint32) TriVertexIndexList

NewTriVertexIndexList returns a new TriVertexIndexList instance.

type UniversalJoint Uses

type UniversalJoint struct {
    JointBase
}

UniversalJoint represents a universal joint.

func (UniversalJoint) AddTorques Uses

func (j UniversalJoint) AddTorques(torque1, torque2 float64)

AddTorques adds torques to the joint.

func (UniversalJoint) Anchor Uses

func (j UniversalJoint) Anchor() Vector3

Anchor returns the anchor point for the first body.

func (UniversalJoint) Anchor2 Uses

func (j UniversalJoint) Anchor2() Vector3

Anchor2 returns the anchor point for the second body.

func (UniversalJoint) Angle1 Uses

func (j UniversalJoint) Angle1() float64

Angle1 returns the first angle.

func (UniversalJoint) Angle1Rate Uses

func (j UniversalJoint) Angle1Rate() float64

Angle1Rate returns the first angle's rate of change.

func (UniversalJoint) Angle2 Uses

func (j UniversalJoint) Angle2() float64

Angle2 returns the second angle.

func (UniversalJoint) Angle2Rate Uses

func (j UniversalJoint) Angle2Rate() float64

Angle2Rate returns the second angle's rate of change.

func (UniversalJoint) Angles Uses

func (j UniversalJoint) Angles() (float64, float64)

Angles returns the two angles.

func (UniversalJoint) Axis1 Uses

func (j UniversalJoint) Axis1() Vector3

Axis1 returns the first axis.

func (UniversalJoint) Axis2 Uses

func (j UniversalJoint) Axis2() Vector3

Axis2 returns the second axis.

func (UniversalJoint) Param Uses

func (j UniversalJoint) Param(parameter int) float64

Param returns a joint parameter.

func (UniversalJoint) SetAnchor Uses

func (j UniversalJoint) SetAnchor(pt Vector3)

SetAnchor sets the anchor point.

func (UniversalJoint) SetAxis1 Uses

func (j UniversalJoint) SetAxis1(axis Vector3)

SetAxis1 sets the first axis.

func (UniversalJoint) SetAxis1Offset Uses

func (j UniversalJoint) SetAxis1Offset(axis Vector3, offset1, offset2 float64)

SetAxis1Offset sets the first axis as if the 2 bodies were already at offset1 and offset2 appart with respect to the first and second axes.

func (UniversalJoint) SetAxis2 Uses

func (j UniversalJoint) SetAxis2(axis Vector3)

SetAxis2 sets the second axis.

func (UniversalJoint) SetAxis2Offset Uses

func (j UniversalJoint) SetAxis2Offset(axis Vector3, offset1, offset2 float64)

SetAxis2Offset sets the second axis as if the 2 bodies were already at offset1 and offset2 appart with respect to the first and second axes.

func (UniversalJoint) SetParam Uses

func (j UniversalJoint) SetParam(parameter int, value float64)

SetParam sets a joint parameter.

type Vector Uses

type Vector []float64

Vector represents a double precision vector.

func NewVector Uses

func NewVector(size, align int, vals ...float64) Vector

NewVector returns a new Vector instance.

type Vector3 Uses

type Vector3 Vector

Vector3 represents a 3 component vector.

func NewVector3 Uses

func NewVector3(vals ...float64) Vector3

NewVector3 returns a new Vector3 instance.

type Vector4 Uses

type Vector4 Vector

Vector4 represents a 4 component vector.

func NewVector4 Uses

func NewVector4(vals ...float64) Vector4

NewVector4 returns a new Vector4 instance.

type VertexList Uses

type VertexList Matrix

VertexList represents a list of 3D vertices.

func NewVertexList Uses

func NewVertexList(size int, vals ...float64) VertexList

NewVertexList returns a new VertexList instance.

type World Uses

type World uintptr

World represents a simulation world.

func NewWorld Uses

func NewWorld() World

NewWorld returns a new World instance.

func (World) AngularDamping Uses

func (w World) AngularDamping() float64

AngularDamping returns the angular damping scale.

func (World) AngularDampingThreshold Uses

func (w World) AngularDampingThreshold() float64

AngularDampingThreshold returns the angular damping threshold.

func (World) AutoDisable Uses

func (w World) AutoDisable() bool

AutoDisable returns whether the body will be auto disabled.

func (World) AutoDisableAngularThreshold Uses

func (w World) AutoDisableAngularThreshold() float64

AutoDisableAngularThreshold returns the auto disable angular average threshold.

func (World) AutoDisableAverageSamplesCount Uses

func (w World) AutoDisableAverageSamplesCount() bool

AutoDisableAverageSamplesCount returns the auto disable sample count.

func (World) AutoDisableLinearThreshold Uses

func (w World) AutoDisableLinearThreshold() float64

AutoDisableLinearThreshold returns the auto disable linear average threshold.

func (World) AutoDisableSteps Uses

func (w World) AutoDisableSteps() int

AutoDisableSteps returns the number of auto disable steps.

func (World) AutoDisableTime Uses

func (w World) AutoDisableTime() float64

AutoDisableTime returns the auto disable time.

func (World) CFM Uses

func (w World) CFM() float64

CFM returns the constraint force mixing value.

func (World) CleanupWorkingMemory Uses

func (w World) CleanupWorkingMemory()

CleanupWorkingMemory cleans up the world's working memory.

func (World) ContactMaxCorrectingVelocity Uses

func (w World) ContactMaxCorrectingVelocity() float64

ContactMaxCorrectingVelocity returns the maximum correcting velocity that contacts are allowed to generate.

func (World) ContactSurfaceLayer Uses

func (w World) ContactSurfaceLayer() float64

ContactSurfaceLayer returns the depth of the surface layer around all geometry objects.

func (World) Data Uses

func (w World) Data() interface{}

Data returns the user-specified data associated with the world.

func (World) Destroy Uses

func (w World) Destroy()

Destroy destroys the world.

func (World) ERP Uses

func (w World) ERP() float64

ERP returns the error reduction parameter.

func (World) Gravity Uses

func (w World) Gravity() Vector3

Gravity returns the gravity vector.

func (World) ImpulseToForce Uses

func (w World) ImpulseToForce(stepSize float64, impulse Vector3) Vector3

ImpulseToForce converts an impulse to a force over a step duration.

func (World) LinearDamping Uses

func (w World) LinearDamping() float64

LinearDamping returns the linear damping scale.

func (World) LinearDampingThreshold Uses

func (w World) LinearDampingThreshold() float64

LinearDampingThreshold returns the linear damping threshold.

func (World) MaxAngularSpeed Uses

func (w World) MaxAngularSpeed() float64

MaxAngularSpeed returns the maximum angular speed.

func (World) NewAMotorJoint Uses

func (w World) NewAMotorJoint(group JointGroup) AMotorJoint

NewAMotorJoint returns a new AMotorJoint instance

func (World) NewBallJoint Uses

func (w World) NewBallJoint(group JointGroup) BallJoint

NewBallJoint returns a new BallJoint instance

func (World) NewBody Uses

func (w World) NewBody() Body

NewBody returns a new Body instance.

func (World) NewContactJoint Uses

func (w World) NewContactJoint(group JointGroup, contact *Contact) ContactJoint

NewContactJoint returns a new ContactJoint instance

func (World) NewDBallJoint Uses

func (w World) NewDBallJoint(group JointGroup) DBallJoint

NewDBallJoint returns a new DBallJoint instance

func (World) NewDHingeJoint Uses

func (w World) NewDHingeJoint(group JointGroup) DHingeJoint

NewDHingeJoint returns a new DHingeJoint instance

func (World) NewFixedJoint Uses

func (w World) NewFixedJoint(group JointGroup) FixedJoint

NewFixedJoint returns a new FixedJoint instance

func (World) NewHinge2Joint Uses

func (w World) NewHinge2Joint(group JointGroup) Hinge2Joint

NewHinge2Joint returns a new Hinge2Joint instance

func (World) NewHingeJoint Uses

func (w World) NewHingeJoint(group JointGroup) HingeJoint

NewHingeJoint returns a new HingeJoint instance

func (World) NewLMotorJoint Uses

func (w World) NewLMotorJoint(group JointGroup) LMotorJoint

NewLMotorJoint returns a new LMotorJoint instance

func (World) NewNullJoint Uses

func (w World) NewNullJoint(group JointGroup) NullJoint

NewNullJoint returns a new NullJoint instance

func (World) NewPRJoint Uses

func (w World) NewPRJoint(group JointGroup) PRJoint

NewPRJoint returns a new PRJoint instance

func (World) NewPUJoint Uses

func (w World) NewPUJoint(group JointGroup) PUJoint

NewPUJoint returns a new PUJoint instance

func (World) NewPistonJoint Uses

func (w World) NewPistonJoint(group JointGroup) PistonJoint

NewPistonJoint returns a new PistonJoint instance

func (World) NewPlane2DJoint Uses

func (w World) NewPlane2DJoint(group JointGroup) Plane2DJoint

NewPlane2DJoint returns a new Plane2DJoint instance

func (World) NewSliderJoint Uses

func (w World) NewSliderJoint(group JointGroup) SliderJoint

NewSliderJoint returns a new SliderJoint instance

func (World) NewTransmissionJoint Uses

func (w World) NewTransmissionJoint(group JointGroup) TransmissionJoint

NewTransmissionJoint returns a new TransmissionJoint instance

func (World) NewUniversalJoint Uses

func (w World) NewUniversalJoint(group JointGroup) UniversalJoint

NewUniversalJoint returns a new UniversalJoint instance

func (World) QuickStep Uses

func (w World) QuickStep(stepSize float64) bool

QuickStep executes a simulation quick step, and returns whether the operation succeeded.

func (World) QuickStepNumIterations Uses

func (w World) QuickStepNumIterations() int

QuickStepNumIterations returns the number of iterations to execute during a quick step.

func (World) QuickStepW Uses

func (w World) QuickStepW() float64

QuickStepW returns the over-relaxation parameter.

func (World) SetAngularDamping Uses

func (w World) SetAngularDamping(scale float64)

SetAngularDamping sets the angular damping scale.

func (World) SetAngularDampingThreshold Uses

func (w World) SetAngularDampingThreshold(threshold float64)

SetAngularDampingThreshold sets the angular damping threshold.

func (World) SetAutoAutoDisableAverageSamplesCount Uses

func (w World) SetAutoAutoDisableAverageSamplesCount(averageSamplesCount bool)

SetAutoAutoDisableAverageSamplesCount sets auto disable average sample count.

func (World) SetAutoDisable Uses

func (w World) SetAutoDisable(doAutoDisable bool)

SetAutoDisable sets wether the body will be auto disabled.

func (World) SetAutoDisableAngularThreshold Uses

func (w World) SetAutoDisableAngularThreshold(angularThreshold float64)

SetAutoDisableAngularThreshold sets the auto disable angular average threshold.

func (World) SetAutoDisableLinearThreshold Uses

func (w World) SetAutoDisableLinearThreshold(linearThreshold float64)

SetAutoDisableLinearThreshold sets the auto disable linear average threshold.

func (World) SetAutoDisableSteps Uses

func (w World) SetAutoDisableSteps(steps int)

SetAutoDisableSteps sets the number of auto disable steps.

func (World) SetAutoDisableTime Uses

func (w World) SetAutoDisableTime(time float64)

SetAutoDisableTime sets the auto disable time.

func (World) SetCFM Uses

func (w World) SetCFM(cfm float64)

SetCFM sets the constraint force mixing value.

func (World) SetContactMaxCorrectingVelocity Uses

func (w World) SetContactMaxCorrectingVelocity(overRelaxation float64)

SetContactMaxCorrectingVelocity sets the maximum correcting velocity that contacts are allowed to generate.

func (World) SetContactSurfaceLayer Uses

func (w World) SetContactSurfaceLayer(depth float64)

SetContactSurfaceLayer sets the depth of the surface layer around all geometry objects.

func (World) SetData Uses

func (w World) SetData(data interface{})

SetData associates user-specified data with the world.

func (World) SetERP Uses

func (w World) SetERP(erp float64)

SetERP sets the error reduction parameter.

func (World) SetGravity Uses

func (w World) SetGravity(grav Vector3)

SetGravity sets the gravity vector.

func (World) SetLinearDamping Uses

func (w World) SetLinearDamping(scale float64)

SetLinearDamping sets the linear damping scale.

func (World) SetLinearDampingThreshold Uses

func (w World) SetLinearDampingThreshold(threshold float64)

SetLinearDampingThreshold sets the linear damping threshold.

func (World) SetMaxAngularSpeed Uses

func (w World) SetMaxAngularSpeed(maxSpeed float64)

SetMaxAngularSpeed sets the maximum angular speed.

func (World) SetQuickStepNumIterations Uses

func (w World) SetQuickStepNumIterations(num int)

SetQuickStepNumIterations sets the number of iterations to execute during a quick step.

func (World) SetQuickStepW Uses

func (w World) SetQuickStepW(overRelaxation float64)

SetQuickStepW sets the over-relaxation parameter.

func (World) SetStepIslandsProcessingMaxThreadCount Uses

func (w World) SetStepIslandsProcessingMaxThreadCount(count int)

SetStepIslandsProcessingMaxThreadCount sets the maximum number of threads to use for island stepping.

func (World) Step Uses

func (w World) Step(stepSize float64) bool

Step executes a simulation step, and returns whether the operation succeeded.

func (World) StepIslandsProcessingMaxThreadCount Uses

func (w World) StepIslandsProcessingMaxThreadCount() int

StepIslandsProcessingMaxThreadCount returns the maximum number of threads to use for island stepping.

func (World) UseSharedWorkingMemory Uses

func (w World) UseSharedWorkingMemory(from World) bool

UseSharedWorkingMemory enables sharing working memory with another world, and returns whether the operation succeeded.

Package ode imports 2 packages (graph). Updated 2016-07-19. Refresh now. Tools for package owners.