Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
ActiveJoint Class Reference
Inheritance diagram for ActiveJoint:
IConfigNode ActiveJointPivot

Public Types

enum  DriveMode { DriveMode.NoJoint, DriveMode.Park, DriveMode.Neutral, DriveMode.Drive }
 
enum  JointMode { JointMode.Motor, JointMode.Pivot, JointMode.Piston }
 

Public Member Functions

void DrawDebug ()
 
void Load (ConfigNode node)
 
void Save (ConfigNode node)
 
void SetAxis (Transform srcSpace, Vector3 axis)
 
bool SetDriveMode (DriveMode m)
 
void SetJointDrive (JointDrive drive)
 
void SetSecondaryAxis (Transform srcSpace, Vector3 secondAxis)
 
void Terminate ()
 Ends all active joint operations. Clears listeners and detaches from joint. Does not destroy the joint itself. More...
 

Static Public Member Functions

static ActiveJoint Create (IActiveJointHost moduleHost, string refNodeId, JointMode function)
 Creates an instance of ModuleJoint to handle the connection at a given attachment node. More...
 
static ActiveJoint Create (IActiveJointHost moduleHost, AttachNode refNode, JointMode function)
 

Public Attributes

float maxJointDamper = 1e20f
 the drive that is being modified on this joint. More...
 
JointDrive targetDrive
 

Protected Member Functions

PartJoint findJointAtNode (AttachNode node)
 
PartJoint findJointBetweenParts (Part p1, Part p2)
 
Vector3 getAnchorOffset (PartSpaceMode mode)
 
Vector3 getControlOrt (Vector3 refAxis, PartSpaceMode mode)
 Returns a reference vector that can be used to measure the angle after a part has been spun around by a rotating joint. Vector will be in target part's local space, use getInvControlOrt to transform that into host local space More...
 
Vector3 getControlPos (Vector3 refPos, PartSpaceMode mode)
 
Vector3 GetCtrlAxis ()
 
Vector3 getInvControlOrt (Vector3 refAxis, PartSpaceMode mode)
 
Vector3 getInvControlPos (Vector3 refPos, PartSpaceMode mode)
 
JointDrive GetJointDrive ()
 
void InitJoint ()
 
virtual void onJointInit (bool jointExists)
 
void restartJoint ()
 
void startForRefNode (string jointNodeName)
 

Protected Attributes

Vector3 activeAxis
 initial and end orientations for measuring motor angles (in vessel space) More...
 
Vector3 anchor
 
float Angle
 
Vector3 axis
 
Vector3 ctrlAxis
 the axis around which the joint rotates. For motors, it will be the joint's primary axis. More...
 
Vector3 dPos
 accumulated offset from the joint tgt pos More...
 
Quaternion dRot
 accumulated rotation from the joint's tgt rot and angular speed More...
 
Part hostPart
 A reference to the part that contains the moduleHost, not to be confused with PartJoint's host. More...
 
Vector3 initOrt
 
Quaternion jointRot0
 
float lastAngle
 
Vector3 lastDPos
 
Quaternion lastDRot
 
IActiveJointHost moduleHost
 
AttachNode refNode
 
bool targetParent
 

Properties

DriveMode driveMode [get, set]
 
bool isValid [get]
 
ConfigurableJoint joint [get, set]
 
JointMode jointMode [get, set]
 
PartJoint pJoint [get, set]
 

Member Enumeration Documentation

Enumerator
NoJoint 
Park 
Neutral 
Drive 
Enumerator
Motor 
Pivot 
Piston 

Member Function Documentation

static ActiveJoint ActiveJoint.Create ( IActiveJointHost  moduleHost,
string  refNodeId,
JointMode  function 
)
inlinestatic

Creates an instance of ModuleJoint to handle the connection at a given attachment node.

Parameters
jointOwnerPartThe IActivePartHost-implementing module that will host this instance (you).
refNodeIdThe id of the attachment node to target. Pass an empty string to target the parent part joint instead of a node. Pass null to cause a bug.
Returns
The active joint instance.
static ActiveJoint ActiveJoint.Create ( IActiveJointHost  moduleHost,
AttachNode  refNode,
JointMode  function 
)
inlinestatic
void ActiveJoint.DrawDebug ( )
inline

< draw current rot (from target local space)

< draw cross vector between them

< draw the joint axis

PartJoint ActiveJoint.findJointAtNode ( AttachNode  node)
inlineprotected
PartJoint ActiveJoint.findJointBetweenParts ( Part  p1,
Part  p2 
)
inlineprotected
Vector3 ActiveJoint.getAnchorOffset ( PartSpaceMode  mode)
inlineprotected
Vector3 ActiveJoint.getControlOrt ( Vector3  refAxis,
PartSpaceMode  mode 
)
inlineprotected

Returns a reference vector that can be used to measure the angle after a part has been spun around by a rotating joint. Vector will be in target part's local space, use getInvControlOrt to transform that into host local space

Returns
Vector3 ActiveJoint.getControlPos ( Vector3  refPos,
PartSpaceMode  mode 
)
inlineprotected
Vector3 ActiveJoint.GetCtrlAxis ( )
inlineprotected
Vector3 ActiveJoint.getInvControlOrt ( Vector3  refAxis,
PartSpaceMode  mode 
)
inlineprotected
Vector3 ActiveJoint.getInvControlPos ( Vector3  refPos,
PartSpaceMode  mode 
)
inlineprotected
JointDrive ActiveJoint.GetJointDrive ( )
inlineprotected
void ActiveJoint.InitJoint ( )
inlineprotected
void ActiveJoint.Load ( ConfigNode  node)
inline

Implements IConfigNode.

virtual void ActiveJoint.onJointInit ( bool  jointExists)
inlineprotectedvirtual

Reimplemented in ActiveJointPivot.

void ActiveJoint.restartJoint ( )
inlineprotected
void ActiveJoint.Save ( ConfigNode  node)
inline

Implements IConfigNode.

void ActiveJoint.SetAxis ( Transform  srcSpace,
Vector3  axis 
)
inline
bool ActiveJoint.SetDriveMode ( DriveMode  m)
inline
void ActiveJoint.SetJointDrive ( JointDrive  drive)
inline
void ActiveJoint.SetSecondaryAxis ( Transform  srcSpace,
Vector3  secondAxis 
)
inline
void ActiveJoint.startForRefNode ( string  jointNodeName)
inlineprotected
void ActiveJoint.Terminate ( )
inline

Ends all active joint operations. Clears listeners and detaches from joint. Does not destroy the joint itself.

Member Data Documentation

Vector3 ActiveJoint.activeAxis
protected

initial and end orientations for measuring motor angles (in vessel space)

Vector3 ActiveJoint.anchor
protected
float ActiveJoint.Angle
protected
Vector3 ActiveJoint.axis
protected
Vector3 ActiveJoint.ctrlAxis
protected

the axis around which the joint rotates. For motors, it will be the joint's primary axis.

Vector3 ActiveJoint.dPos
protected

accumulated offset from the joint tgt pos

Quaternion ActiveJoint.dRot
protected

accumulated rotation from the joint's tgt rot and angular speed

Part ActiveJoint.hostPart
protected

A reference to the part that contains the moduleHost, not to be confused with PartJoint's host.

Vector3 ActiveJoint.initOrt
protected
Quaternion ActiveJoint.jointRot0
protected
float ActiveJoint.lastAngle
protected
Vector3 ActiveJoint.lastDPos
protected
Quaternion ActiveJoint.lastDRot
protected
float ActiveJoint.maxJointDamper = 1e20f

the drive that is being modified on this joint.

IActiveJointHost ActiveJoint.moduleHost
protected
AttachNode ActiveJoint.refNode
protected
JointDrive ActiveJoint.targetDrive
bool ActiveJoint.targetParent
protected

Property Documentation

DriveMode ActiveJoint.driveMode
getset
bool ActiveJoint.isValid
get
ConfigurableJoint ActiveJoint.joint
getset
JointMode ActiveJoint.jointMode
getset
PartJoint ActiveJoint.pJoint
getset

The documentation for this class was generated from the following file: