LuaDocs/MovableObject
From Data Realms Wiki
m (Whitespace. Assume there's some reason and meaning why certain sentences had been given no space after period; preserved in code though will display as a space, not new line.) |
(MovableObject - Automatically generated by LuaBot) |
||
(13 intermediate revisions not shown) | |||
Line 10: | Line 10: | ||
==Properties== | ==Properties== | ||
===ClassName=== | ===ClassName=== | ||
- | The class name of this Entity. | + | The class name of this Entity.A string with the friendly-formatted type name of this object. |
- | A string with the friendly-formatted type name of this object. | + | |
===Mass=== | ===Mass=== | ||
- | The mass value of this MovableObject. | + | The mass value of this MovableObject.A float describing the mass value in Kilograms (kg). |
- | A float describing the mass value in Kilograms (kg). | + | |
===Vel=== | ===Vel=== | ||
- | The velocity vector of this MovableObject. | + | The velocity vector of this MovableObject.A Vector describing the current velocity vector. |
- | A Vector describing the current velocity vector. | + | |
===AngularVel=== | ===AngularVel=== | ||
- | The current angular velocity of this MovableObject. Positive is a counter-clockwise rotation. | + | The current angular velocity of this MovableObject. Positive is a counter-clockwise rotation.The angular velocity in radians per second. |
- | The angular velocity in radians per second. | + | |
===Radius=== | ===Radius=== | ||
- | Read-only property. The largest radius of this in pixels. | + | Read-only property. The largest radius of this in pixels.The radius from its center to the edge of its graphical representation. |
- | The radius from its center to the edge of its graphical representation. | + | |
===Diameter=== | ===Diameter=== | ||
- | Read-only property. The largest diameter of this in pixels. | + | Read-only property. The largest diameter of this in pixels.The largest diameter across its graphical representation. |
- | The largest diameter across its graphical representation. | + | |
===Scale=== | ===Scale=== | ||
- | The current scale of this MOSRotating. This is mostly for fun. | + | The current scale of this MOSRotating. This is mostly for fun.The normalized scale. |
- | The normalized scale. | + | |
+ | ===GlobalAccScalar=== | ||
+ | Read-only property. Gets How this is affected by global effects, from +1.0 to -1.0. Something with a negative value will 'float' upward.The global acceleration scalar. | ||
+ | |||
+ | ===AirResistance=== | ||
+ | Read-only property. How much this is affected by air resistance when traveling over a second, 0 to 1.0, with 0 as defaultThe air resistance coefficient. | ||
+ | |||
+ | ===AirThreshold=== | ||
+ | Read-only property. At which threshold of velocity, in m/s, the effect of AirResistance kicks in.The air threshold speed. | ||
===Age=== | ===Age=== | ||
- | Gets real time age of this MovableObject. | + | Gets real time age of this MovableObject.A unsigned long describing the current age in ms. |
- | A unsigned long describing the current age in ms. | + | |
===Lifetime=== | ===Lifetime=== | ||
- | The amount of time this MovableObject will exist from creation. | + | The amount of time this MovableObject will exist from creation.A unsigned long describing the current lifetime in ms. 0 means unlimited. |
- | A unsigned long describing the current lifetime in ms. 0 means unlimited. | + | |
===ID=== | ===ID=== | ||
- | Read-only property. The MOID of this MovableObject for this frame. | + | Read-only property. The MOID of this MovableObject for this frame.An int specifying the MOID that this MovableObject is assigned for the current frame only. |
- | An | + | |
+ | ===UniqueID=== | ||
+ | Read-only property. Returns this MO's unique persistent IDReturns this MO's unique persistent ID | ||
===RootID=== | ===RootID=== | ||
- | Read-only property. The MOID of the MovableObject which is the root MO of this MO for this frame. If same as what GetID returns, then this is owned by MovableMan. | + | Read-only property. The MOID of the MovableObject which is the root MO of this MO for this frame. If same as what GetID returns, then this is owned by MovableMan.An int specifying the MOID of the MO that this MovableObject is owned by for the current frame only. |
- | An | + | |
===MOIDFootprint=== | ===MOIDFootprint=== | ||
- | Read-only property. Gets how many total (subsequent) MOID's this MO and all its children are taking up this frame. ie if this MO has no children, this will likely be 1. Note this is only valid for this frame! | + | Read-only property. Gets how many total (subsequent) MOID's this MO and all its children are taking up this frame. ie if this MO has no children, this will likely be 1. Note this is only valid for this frame!The number of MOID indices this MO and all its children are taking up. |
- | The number of MOID indices this MO and all its children are taking up. | + | |
===Sharpness=== | ===Sharpness=== | ||
- | The sharpness factor of this MO. | + | The sharpness factor of this MO.The sharpness factor of this MO. 1.0 means normal sharpness, no alter- ation to any of the impulses. |
- | The sharpness factor of this MO. 1.0 means normal sharpness, no alter- ation to any of the impulses. | + | |
===AboveHUDPos=== | ===AboveHUDPos=== | ||
- | Read-only property. The absoltue position of the top of this' HUD stack. | + | Read-only property. The absoltue position of the top of this' HUD stack.A Vector with the absolute position of this' HUD stack top point. |
- | A Vector with the absolute position of this' HUD stack top point. | + | |
===HitsMOs=== | ===HitsMOs=== | ||
- | Gets whether this MovableObject is set to collide with other MovableObject:s during its travel. | + | Gets whether this MovableObject is set to collide with other MovableObject:s during its travel.Whether this hits other MO's during its travel, or not. |
- | Whether this hits other MO's during its travel, or not. | + | |
===GetsHitByMOs=== | ===GetsHitByMOs=== | ||
- | Gets whether this MovableObject is set to be able to get hit by other MovableObject:s during their travel. | + | Gets whether this MovableObject is set to be able to get hit by other MovableObject:s during their travel.Whether this can get hit by MO's, or not. |
- | Whether this can get hit by MO's, or not. | + | |
===IgnoresTeamHits=== | ===IgnoresTeamHits=== | ||
- | Tells whether this will collide with any other MO of the same team. | + | Tells whether this will collide with any other MO of the same team.Whether this can hit or get hit by other MOs of the same team. |
- | Whether this can hit or get hit by other MOs of the same team. | + | |
===IgnoresWhichTeam=== | ===IgnoresWhichTeam=== | ||
- | Read-only property. Tells which team this would be ignoring hits with, if we're ignoring hits at all. | + | Read-only property. Tells which team this would be ignoring hits with, if we're ignoring hits at all.Which team this ignores hits with, if any. |
- | Which team this ignores hits with, if any. | + | |
===ToSettle=== | ===ToSettle=== | ||
- | Indicates whether this MO is marked for settling at the end of the MovableMan update. | + | Indicates whether this MO is marked for settling at the end of the MovableMan update.Whether this MO is marked for settling ontot the terrain or not. |
- | Whether this MO is marked for settling ontot the terrain or not. | + | |
===ToDelete=== | ===ToDelete=== | ||
- | Indicates whether this MO is marked for deletion at the end of the MovableMan update. | + | Indicates whether this MO is marked for deletion at the end of the MovableMan update.Whether this MO is marked for deletion or not. |
- | Whether this MO is marked for deletion or not. | + | |
===HUDVisible=== | ===HUDVisible=== | ||
- | Tells whether this Actor's HUD is drawn or not. | + | Tells whether this Actor's HUD is drawn or not.Whether this' HUD gets drawn or not. |
- | Whether this' HUD gets drawn or not. | + | |
===PinStrength=== | ===PinStrength=== | ||
- | The impulse force threshold which has to be exceeded to 'shake loose' this from a 'pinned' state. Pinned MOs don't get moved by travel algos. If 0, this isn't pinned. | + | The impulse force threshold which has to be exceeded to 'shake loose' this from a 'pinned' state. Pinned MOs don't get moved by travel algos. If 0, this isn't pinned.The impulse threshold in kg * (m/s). 0 means no pinning |
- | The impulse threshold in kg * (m/s). 0 means no pinning | + | |
==Functions== | ==Functions== | ||
Line 150: | Line 141: | ||
===IsMissionCritical=== | ===IsMissionCritical=== | ||
- | Shows whether this is mission critical and | + | Shows whether this is mission critical and should therefore NEVER be settled or otherwise destroyed during teh course of a mission. |
'''Arguments:''' | '''Arguments:''' | ||
- | * None | + | * None. |
'''Return value:''' | '''Return value:''' | ||
- | + | Whetehr this should be immune to settling and destruction. | |
+ | |||
===IsGeneric=== | ===IsGeneric=== |
Latest revision as of 20:17, 2 April 2015
Parent: SceneObject
Abstract Class. A movable object with mass.
Properties
ClassName
The class name of this Entity.A string with the friendly-formatted type name of this object.
Mass
The mass value of this MovableObject.A float describing the mass value in Kilograms (kg).
Vel
The velocity vector of this MovableObject.A Vector describing the current velocity vector.
AngularVel
The current angular velocity of this MovableObject. Positive is a counter-clockwise rotation.The angular velocity in radians per second.
Radius
Read-only property. The largest radius of this in pixels.The radius from its center to the edge of its graphical representation.
Diameter
Read-only property. The largest diameter of this in pixels.The largest diameter across its graphical representation.
Scale
The current scale of this MOSRotating. This is mostly for fun.The normalized scale.
GlobalAccScalar
Read-only property. Gets How this is affected by global effects, from +1.0 to -1.0. Something with a negative value will 'float' upward.The global acceleration scalar.
AirResistance
Read-only property. How much this is affected by air resistance when traveling over a second, 0 to 1.0, with 0 as defaultThe air resistance coefficient.
AirThreshold
Read-only property. At which threshold of velocity, in m/s, the effect of AirResistance kicks in.The air threshold speed.
Age
Gets real time age of this MovableObject.A unsigned long describing the current age in ms.
Lifetime
The amount of time this MovableObject will exist from creation.A unsigned long describing the current lifetime in ms. 0 means unlimited.
ID
Read-only property. The MOID of this MovableObject for this frame.An int specifying the MOID that this MovableObject is assigned for the current frame only.
UniqueID
Read-only property. Returns this MO's unique persistent IDReturns this MO's unique persistent ID
RootID
Read-only property. The MOID of the MovableObject which is the root MO of this MO for this frame. If same as what GetID returns, then this is owned by MovableMan.An int specifying the MOID of the MO that this MovableObject is owned by for the current frame only.
MOIDFootprint
Read-only property. Gets how many total (subsequent) MOID's this MO and all its children are taking up this frame. ie if this MO has no children, this will likely be 1. Note this is only valid for this frame!The number of MOID indices this MO and all its children are taking up.
Sharpness
The sharpness factor of this MO.The sharpness factor of this MO. 1.0 means normal sharpness, no alter- ation to any of the impulses.
AboveHUDPos
Read-only property. The absoltue position of the top of this' HUD stack.A Vector with the absolute position of this' HUD stack top point.
HitsMOs
Gets whether this MovableObject is set to collide with other MovableObject:s during its travel.Whether this hits other MO's during its travel, or not.
GetsHitByMOs
Gets whether this MovableObject is set to be able to get hit by other MovableObject:s during their travel.Whether this can get hit by MO's, or not.
IgnoresTeamHits
Tells whether this will collide with any other MO of the same team.Whether this can hit or get hit by other MOs of the same team.
IgnoresWhichTeam
Read-only property. Tells which team this would be ignoring hits with, if we're ignoring hits at all.Which team this ignores hits with, if any.
ToSettle
Indicates whether this MO is marked for settling at the end of the MovableMan update.Whether this MO is marked for settling ontot the terrain or not.
ToDelete
Indicates whether this MO is marked for deletion at the end of the MovableMan update.Whether this MO is marked for deletion or not.
HUDVisible
Tells whether this Actor's HUD is drawn or not.Whether this' HUD gets drawn or not.
PinStrength
The impulse force threshold which has to be exceeded to 'shake loose' this from a 'pinned' state. Pinned MOs don't get moved by travel algos. If 0, this isn't pinned.The impulse threshold in kg * (m/s). 0 means no pinning
Functions
ReloadScripts
Reloads the preset scripts of this object, from the same script file path as was originally defined. This will also update the original preset in the PresetMan with the updated scripts so future objects spawned will use the new scripts.
Arguments:
- None.
Return value:
An error return value signaling sucess or any particular failure. Anything below 0 is an error signal.
GetAltitude
Gets the altitide of this' pos (or appropriate low point) over the terrain, in pixels.
Arguments:
- The max altitude you care to check for. 0 Means check the whole scene's height.
- The accuracy within which measurement is acceptable. Higher number here means less calculation.
Return value:
The rough altitude over the terrain, in pixels.
SetWhichMOToNotHit
Sets this MO to not hit a specific other MO and all its children even though MO hitting is enabled on this MovableObject
Arguments:
- A pointer to the MO to not be hitting. 0 means don't ignore anyhting.
- Ownership is not transferred!
- For how long, in S, to ignore the above. Negative number means forever.
Return value:
None.
IsSetToDelete
Tells if this MovableObject is marked for deletion at the end of the update.
Arguments:
- None.
Return value:
Whether this is marked for deletion or not.
IsMissionCritical
Shows whether this is mission critical and should therefore NEVER be settled or otherwise destroyed during teh course of a mission.
Arguments:
- None.
Return value:
Whetehr this should be immune to settling and destruction.
IsGeneric
Indicates whether this MO is an Generic or not.
Arguments:
- None.
Return value:
Whether this MovableObject is of Type Generic or not.
IsActor
Indicates whether this MO is an Actor or not.
Arguments:
- None.
Return value:
Whether this MovableObject is of Type Actor or not.
IsDevice
Indicates whether this MO is a Device or not.
Arguments:
- None.
Return value:
Whether this MovableObject is of Type Device (Held or Thrown) or not.
IsHeldDevice
Indicates whether this MO is a HeldDevice or not.
Arguments:
- None.
Return value:
Whether this MovableObject is of Type HeldDevice or not.
IsThrownDevice
Indicates whether this MO is a ThrownDevice or not.
Arguments:
- None.
Return value:
Whether this MovableObject is of Type ThrownDevice or not.
IsGold
Indicates whether this MO is made of Gold or not.
Arguments:
- None.
Return value:
Whether this MovableObject is of Gold or not.
IsThrownDevice
Indicates whether this MO is a ThrownDevice or not.
Arguments:
- None.
Return value:
Whether this MovableObject is of Type ThrownDevice or not.
HasObject
Shows whether this is or carries a specifically named object in its inventory. Also looks through the inventories of potential passengers, as applicable.
Arguments:
- The Preset name of the object to look for.
Return value:
Whetehr the object was found carried by this.
HasObjectInGroup
Shows whether this is or carries a specifically grouped object in its inventory. Also looks through the inventories of potential passengers, as applicable.
Arguments:
- The name of the group to look for.
Return value:
Whetehr the object in the group was found carried by this.
AddForce
Adds force to this MovableObject for the next time Update() is called.
Arguments:
- An Vector with the external force vector that will be added to this
- MovableObject and affect its path next Update(). In N or kg * m/s^2.
- A Vector with the offset, in METERS, of where the force is being applied relative to the center of this MovableObject.
Return value:
None.
AddAbsForce
Adds force to this MovableObject for the next time Update() is called.
Arguments:
- An Vector with the external force vector that will be added to this
- MovableObject and affect its path next Update(). In N or kg * m/s^2.
- A Vector with the absolute world coordinates, in PIXELS, of where the force is being applied to the center of this MovableObject.
Return value:
None.
AddImpulseForce
Adds impulse force (or instant momentum) to this MovableObject for the next time Update() is called.
Arguments:
- An Vector with the impulse force vector that will directly be added to this MovableObject's momentum next Update(). In kg * m/s.
- A Vector with the offset, in METERS, of where the impulse is being applied relative to the center of this MovableObject.
Return value:
None.
AddAbsImpulseForce
Adds impulse force (or instant momentum) to this MovableObject for the next time Update() is called.
Arguments:
- An Vector with the impulse force vector that will directly be added to this MovableObject's momentum next Update(). In kg * m/s.
- A Vector with the absolute world coordinates, in PIXELS, of where the force is being applied to the center of this MovableObject.
Return value:
None.
ClearForces
Clears out all the forces this MO has accumulated during this frame.
Arguments:
- None.
Return value:
None.
ClearImpulseForces
Clears out all the impulses this MO has accumulated during this frame.
Arguments:
- None.
Return value:
None.
RestDetection
Does the calculations necessary to detect whether this MO appears to have has settled in the world and is at rest or not. IsAtRest() retreves the answer.
Arguments:
- None.
Return value:
None.
NotResting
Makes this MO reset its tiemr that keeps track of how long it's been at rest, effectively delaying it.
Arguments:
- None.
Return value:
None.
IsAtRest
Indicates wheter the MovableObject has been at rest (no velocity) for more than one (1) second.
Arguments:
- None.
Return value:
Wheter the MovableObject has been at rest for more than one full second.
MoveOutOfTerrain
Checks whether any of the Atom:s in this MovableObject are on top of terrain pixels, and if so, attempt to move this out so none of this' Atoms are on top of the terrain any more.
Arguments:
- Only consider materials stronger than this in the terrain for intersections.
Return value:
Whether any intersection was successfully resolved. Will return true even if there wasn't any intersections to begin with.
RotateOffset
Rotates a vector offset from this MORotating's position according to the rotate angle and flipping.
Arguments:
- A const reference the offset Vector to rotate.
Return value:
A new vector that is the result of the rotation.