TestSphereAgainstWorld
Jump to navigation
Jump to search
Syntax
Return values labelled for ease of reference.
bool -- hit element -- hitElement float float float -- worldModelPositionX,Y,Z float float float -- worldModelRotationX,Y,Z int -- worldModelID int -- worldLODModelID string -- entity type (vehicle, ped, object etc.) testSphereAgainstWorld ( float startX, float startY, float startZ, float radius, [ bool ignoredElement = nil, bool checkBuildings = true, bool checkVehicles = true, bool checkPeds = true, bool checkObjects = true, bool checkDummies = true, bool ignoreSomeObjectsForCamera = false ] )
Required Arguments
- startX: The start x position
- startY: The start y position
- startZ: The start z position
- radius: The radius of the sphere.
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
- ignoredElement: Specifies the element to be excluded from collision detection within the sphere.
- checkBuildings: Specifies whether buildings should be detected, i.e., elements of the default GTA map or those created using createBuilding.
- checkVehicles: Specifies whether vehicles should be detected.
- checkPeds: Specifies whether peds (including players) should be detected.
- checkObjects: Specifies whether objects should be detected.
- checkDummies: Specifies whether internal GTA dummies should be detected. These are not used in the current MTA version so this argument can be set to false.
- ignoreSomeObjectsForCamera: Specifies whether certain elements should be ignored. These are objects that have the (K) property in the 'object.dat' file. (i.e. Most dynamic objects like boxes or barrels).
Returns
The modelID, lodID, worldModelPositionX,Y,Z, worldModelRotationX,Y,Z and entityType parameters are returned even if hitElement is nil.
- hit: true if there is a collision, false otherwise.
- hitElement: the MTA element hit if any, nil otherwise.
- worldModelPositionX,Y,Z: World position of the detected element.
- worldModelRotationX,Y,Z: World rotation of the detected element.
- modelID: The ID of the element.
- lodID: The ID of the element's LOD (or 0).
- entityType: The type of the element (building, vehicle, ped, object, dummy).
Examples
Script Example Missing Function TestSphereAgainstWorld needs a script example, help out by writing one. | |
Before submitting check out Editing Guidelines Script Examples. |
See Also
- createSWATRope
- getBirdsEnabled
- getCoronaReflectionsEnabled
- getGarageBoundingBox
- getGaragePosition
- getGarageSize
- getGroundPosition
- getInteriorFurnitureEnabled
- getNearClipDistance
- getPedsLODDistance
- getRoofPosition
- getScreenFromWorldPosition
- getVehiclesLODDistance
- getWorldFromScreenPosition
- isAmbientSoundEnabled
- isLineOfSightClear
- isWorldSoundEnabled
- processLineOfSight
- resetAmbientSounds
- resetBlurLevel
- resetColorFilter
- resetCoronaReflectionsEnabled
- resetNearClipDistance
- resetPedsLODDistance
- resetVehiclesLODDistance
- resetWorldSounds
- setAmbientSoundEnabled
- setBirdsEnabled
- setColorFilter
- setCoronaReflectionsEnabled
- setInteriorFurnitureEnabled
- setInteriorSoundsEnabled
- setNearClipDistance
- setPedsLODDistance
- setVehiclesLODDistance
- setWorldSoundEnabled
- testLineAgainstWater
- areTrafficLightsLocked
- getAircraftMaxHeight
- getAircraftMaxVelocity
- getCloudsEnabled
- getFarClipDistance
- getFogDistance
- getGameSpeed
- getGravity
- getHeatHaze
- getInteriorSoundsEnabled
- getJetpackMaxHeight
- getMinuteDuration
- getMoonSize
- getOcclusionsEnabled
- getRainLevel
- getSunColor
- getSunSize
- getTime
- getTrafficLightState
- getWeather
- getWindVelocity
- getSkyGradient
- getPlayerBlurLevel
- getZoneName
- isGarageOpen
- removeWorldModel
- resetFarClipDistance
- resetFogDistance
- resetHeatHaze
- resetMoonSize
- resetRainLevel
- resetSkyGradient
- resetSunColor
- resetSunSize
- resetWindVelocity
- restoreAllWorldModels
- restoreWorldModel
- setAircraftMaxHeight
- setAircraftMaxVelocity
- setCloudsEnabled
- setFarClipDistance
- setFogDistance
- setGameSpeed
- setGarageOpen
- setGravity
- setHeatHaze
- setInteriorSoundsEnabled
- setMinuteDuration
- setMoonSize
- setOcclusionsEnabled
- setRainLevel
- setSkyGradient
- setSunColor
- setSunSize
- setTime
- setTrafficLightState
- setTrafficLightsLocked
- setWeather
- setWeatherBlended
- setWindVelocity
- setJetpackMaxHeight
- setPlayerBlurLevel