VE Lua Documentation

Press F to search!

getGravityVector

Definition


-- @/=[C]:-1
function getGravityVector(...)

Callers

@/lua/vehicle/controller/tech/advancedIMU.lua
  computeSensorFrame(n1, n2, n3) -- Compute the sensor frame in world space.
  local gravity = obj:getGravityVector() -- Gravity vector in world space.
  return gravity:dot(forwardWS), gravity:dot(upWS), gravity:dot(rightWS) -- Transform gravity from world space to the sensor frame.
  if state.isUsingGravity then -- Add on the acceleration due to gravity (as a vector), if requested.
    totalAccel:setAdd(obj:getGravityVector())
  end
@/lua/vehicle/scriptai.lua
  -- target bending
  local grleft = aiLeftVec:dot(obj:getGravityVector())
  if deviation * grleft > 0 then