Entity::getRotation
rotationOrder refers to the order yaw pitch roll is applied
value ranges from 0 to 5. What you use for rotationOrder when getting must be the same as rotationOrder when setting the rotation.
Unsure what value corresponds to what rotation order, more testing will be needed for that.
------
rotationOrder is usually 2 in scripts
------
ENTITY::GET_ENTITY_ROTATION(Any p0, false or true);
if false than return from -180 to 180
if true than return from -90 to 90
---
As said above, the value of p1 affects the outcome. R* uses 1 and 2 instead of 0 and 1, so I marked it as an int.
What it returns is the yaw on the z part of the vector, which makes sense considering R* considers z as vertical. Here's a picture for those of you who don't understand pitch, yaw, and roll:
www.allstar.fiu.edu/aero/images/pic5-1.gif
I don't know why it returns a Vec3, but sometimes the values x and y go negative, yet they're always zero. Just use GET_ENTITY_PITCH and GET_ENTITY_ROLL for pitch and roll.
Syntax
entity.getRotation(rotationOrder);Required Arguments
- rotationOrder: int
Return value
- Vector3
Example
// todoSee also
- Entity.applyForceToCenterOfMass
- Entity.applyForceTo
- Entity.attachToPhysically
- Entity.attachTo
- Entity.clearLastDamage
- Entity.createForcedObject
- Entity.createModelHideExcludingScriptObjects
- Entity.createModelHide
- Entity.createModelSwap
- Entity.detach
- Entity.doesBelongToThisScript
- Entity.doesExist
- Entity.doesHaveDrawable
- Entity.doesHavePhysics
- Entity.findAnimEventPhase
- Entity.forceAiAndAnimationUpdate
- Entity.freezePosition
- Entity.getAlpha
- Entity.getAnimCurrentTime
- Entity.getAnimTotalTime
- Entity.getAttachedTo
- Entity.getBoneIndexByName
- Entity.getCollisionNormalOfLastHitFor
- Entity.getCoords
- Entity.getEntityAnimDuration
- Entity.getForwardVector
- Entity.getForwardX
- Entity.getForwardY
- Entity.getHeading
- Entity.getHealth
- Entity.getHeightAboveGround
- Entity.getHeight
- Entity.getLastMaterialHitBy
- Entity.getLodDist
- Entity.getMatrix
- Entity.getMaxHealth
- Entity.getModel
- Entity.getNearestPlayerToOnTeam
- Entity.getNearestPlayerTo
- Entity.getObjectIndexFromIndex
- Entity.getOffsetFromGivenWorldCoords
- Entity.getOffsetFromInWorldCoords
- Entity.getPedIndexFromIndex
- Entity.getPhysicsHeading
- Entity.getPitch
- Entity.getPopulationType
- Entity.getQuaternion
- Entity.getRoll
- Entity.getRotationVelocity
- Entity.getRotation
- Entity.getScript
- Entity.getSpeedVector
- Entity.getSpeed
- Entity.getSubmergedLevel
- Entity.getType
- Entity.getUprightValue
- Entity.getVehicleIndexFromIndex
- Entity.getVelocity
- Entity.getWorldPositionOfBone
- Entity.hasAnimEventFired
- Entity.hasAnimFinished
- Entity.hasBeenDamagedByAnyObject
- Entity.hasBeenDamagedByAnyPed
- Entity.hasBeenDamagedByAnyVehicle
- Entity.hasBeenDamagedBy
- Entity.hasClearLosToInFront
- Entity.hasClearLosTo
- Entity.hasCollidedWithAnything
- Entity.hasCollisionLoadedAround
- Entity.isAMission
- Entity.isAPed
- Entity.isAVehicle
- Entity.isAnEntity
- Entity.isAnObject
- Entity.isAtCoord
- Entity.isAttachedToAnyObject
- Entity.isAttachedToAnyPed
- Entity.isAttachedToAnyVehicle
- Entity.isAttachedTo
- Entity.isAttached
- Entity.isAt
- Entity.isCollisonDisabled
- Entity.isDead
- Entity.isInAir
- Entity.isInAngledArea
- Entity.isInArea
- Entity.isInWater
- Entity.isInZone
- Entity.isOccluded
- Entity.isOnScreen
- Entity.isPlayingAnim
- Entity.isStatic
- Entity.isTouchingModel
- Entity.isTouching
- Entity.isUpright
- Entity.isUpsidedown
- Entity.isVisibleToScript
- Entity.isVisible
- Entity.isWaitingForWorldCollision
- Entity.playAnim
- Entity.playSynchronizedAnim
- Entity.playSynchronizedMapEntityAnim
- Entity.processAttachments
- Entity.removeForcedObject
- Entity.removeModelHide
- Entity.removeModelSwap
- Entity.resetAlpha
- Entity.setAlpha
- Entity.setAlwaysPrerender
- Entity.setAnimCurrentTime
- Entity.setAnimSpeed
- Entity.setAsMission
- Entity.setCanBeDamagedByRelationshipGroup
- Entity.setCanBeDamaged
- Entity.setCanBeTargetedWithoutLos
- Entity.setCollision
- Entity.setCoords2
- Entity.setCoordsNoOffset
- Entity.setCoords
- Entity.setDynamic
- Entity.setHasGravity
- Entity.setHeading
- Entity.setHealth
- Entity.setInvincible
- Entity.setIsTargetPriority
- Entity.setLights
- Entity.setLoadCollisionFlag
- Entity.setLodDist
- Entity.setMaxHealth
- Entity.setMaxSpeed
- Entity.setMotionBlur
- Entity.setNoCollision
- Entity.setObjectAsNoLongerNeeded
- Entity.setOnlyDamagedByPlayer
- Entity.setOnlyDamagedByRelationshipGroup
- Entity.setProofs
- Entity.setQuaternion
- Entity.setRecordsCollisions
- Entity.setRenderScorched
- Entity.setRotation
- Entity.setTrafficlightOverride
- Entity.setVelocity
- Entity.setVisible
- Entity.stopAnim
- Entity.stopSynchronizedAnim
- Entity.stopSynchronizedMapEntityAnim
- Entity.wouldEntityBeOccluded