Script v1_7_1_0
- AI
- Animals
- Collections
- Contracts
- Debug
- Economy
- Elements
- EnvironmentalScore
- Errors
- Events
- GUI
- Handtools
- Hud
- I3d
- Input
- Jobs
- Maps
- Materials
- Misc
- Objects
- AnimatedMapObject
- AnimatedObject
- Bale
- Basketball
- BgaSellStation
- BunkerSilo
- BuyingStation
- DigitalDisplay
- DogBall
- HelpIcons
- InlineBale
- InlineBaleSingle
- LoadingStation
- MountableObject
- NightIllumination
- Nightlight2
- NightlightFlicker
- PackedBale
- PhysicsObject
- ProductionPoint
- Rotator
- SellingStation
- SimParticleSystem
- Storage
- SunAdmirer
- TourIconsMobile
- UnloadingStation
- VehicleSellingPoint
- WildlifeSpawner
- Parameters
- Placeables
- Placement
- Player
- Shop
- Sounds
- Specialization
- Specializations
- StateMachine
- Statistics
- Tasks
- Triggers
- Utils
- Vehicles
Engine v1_7_1_0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- general
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- NoteNode
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- VoiceChat
- XML
Foundation Reference
MountableObject
ParentPhysicsObjectFunctions
additionalMountingMassRaycastCallback
DescriptionCallback used when raycast hits an object.Definition
additionalMountingMassRaycastCallback(integer hitObjectId, float x, float y, float z, float distance, float nx, float ny, float nz, integer subShapeIndex, integer shapeId, boolean isLast)Arguments
integer | hitObjectId | scenegraph object id |
float | x | world x hit position |
float | y | world y hit position |
float | z | world z hit position |
float | distance | distance at which the cast hit the object |
float | nx | normal x direction |
float | ny | normal y direction |
float | nz | normal z direction |
integer | subShapeIndex | sub shape index |
integer | shapeId | id of shape |
boolean | isLast | is last hit |
bool | return | false to stop raycast |
275 | function MountableObject:additionalMountingMassRaycastCallback(hitObjectId, x, y, z, distance, nx, ny, nz, subShapeIndex, shapeId, isLast) |
276 | local object = g_currentMission.nodeToObject[hitObjectId] |
277 | if object ~= self and object ~= nil and object:isa(MountableObject) then |
278 | self.additionalMountingMass = self.additionalMountingMass + object:getMass() |
279 | self.additionalMountingMass = self.additionalMountingMass + object:getAdditionalMountingMass() |
280 | |
281 | return false |
282 | end |
283 | end |
getAdditionalMountingMass
DescriptionReturns recursively the mass of objects laying on top of the mountable objectDefinition
getAdditionalMountingMass()Code
248 | function MountableObject:getAdditionalMountingMass() |
249 | local distance = self:getAdditionalMountingDistance() |
250 | if distance > 0 then |
251 | local x, y, z = getWorldTranslation(self.nodeId) |
252 | self.additionalMountingMass = 0 |
253 | raycastAll(x, y, z, 0, 1, 0, "additionalMountingMassRaycastCallback", distance + 0.1, self, CollisionFlag.VEHICLE, false, false) |
254 | |
255 | return self.additionalMountingMass |
256 | end |
257 | |
258 | return 0 |
259 | end |
setWorldPositionQuaternion
DescriptionSet world poseDefinition
setWorldPositionQuaternion(float x, float y, float z, float xRot, float yRot, float zRot, float w_rot)Arguments
float | x | x position |
float | y | z position |
float | z | z position |
float | xRot | x rotation |
float | yRot | y rotation |
float | zRot | z rotation |
float | w_rot | w rotation |
315 | function MountableObject:setWorldPositionQuaternion(x, y, z, quatX, quatY, quatZ, quatW, changeInterp) |
316 | if not self.isServer then |
317 | if self.dynamicMountType ~= MountableObject.MOUNT_TYPE_KINEMATIC and self.dynamicMountType ~= MountableObject.MOUNT_TYPE_DEFAULT then |
318 | MountableObject:superClass().setWorldPositionQuaternion(self, x, y, z, quatX, quatY, quatZ, quatW, changeInterp) |
319 | end |
320 | else |
321 | MountableObject:superClass().setWorldPositionQuaternion(self, x, y, z, quatX, quatY, quatZ, quatW, changeInterp) |
322 | end |
323 | end |