Difference between revisions of "R3d.Body:testPointInside"
From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>") |
|||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
| − | |||
'''Available since:''' Gideros 2019.10<br/> | '''Available since:''' Gideros 2019.10<br/> | ||
'''Class:''' [[R3d.Body]]<br/> | '''Class:''' [[R3d.Body]]<br/> | ||
=== Description === | === Description === | ||
| − | Checks if a point is inside | + | Checks if a 3D point is inside a RigidBody. |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
(bool) = r3d.Body:testPointInside(x,y,z) | (bool) = r3d.Body:testPointInside(x,y,z) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| + | |||
| + | '''World Query Collider''' | ||
| + | |||
| + | A world query collider is a collider used to perform world queries on it. World queries are manual queries perform on the physics world like raycasting or testing if two colliders (fixtures) collide or overlap. | ||
=== Parameters === | === Parameters === | ||
| − | '''x''': (number) the position of the point in the | + | '''x''': (number) the position of the point in the x axis world coordinate<br/> |
| − | '''y''': (number) the position of the point in the | + | '''y''': (number) the position of the point in the y axis world coordinate<br/> |
| − | '''z''': (number) the position of the point in the | + | '''z''': (number) the position of the point in the z axis world coordinate<br/> |
=== Return values === | === Return values === | ||
| − | '''Returns''' (boolean) true if a point is inside | + | '''Returns''' (boolean) true if a point is inside a RigidBody<br/> |
=== Example === | === Example === | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
| − | + | local tpi = player1.body:testPointInside(0, 1, 0) | |
| + | if tpi then | ||
| + | print(tpi) | ||
| + | end | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{R3d.Body}} | {{R3d.Body}} | ||
Latest revision as of 01:50, 19 December 2025
Available since: Gideros 2019.10
Class: R3d.Body
Description
Checks if a 3D point is inside a RigidBody.
(bool) = r3d.Body:testPointInside(x,y,z)
World Query Collider
A world query collider is a collider used to perform world queries on it. World queries are manual queries perform on the physics world like raycasting or testing if two colliders (fixtures) collide or overlap.
Parameters
x: (number) the position of the point in the x axis world coordinate
y: (number) the position of the point in the y axis world coordinate
z: (number) the position of the point in the z axis world coordinate
Return values
Returns (boolean) true if a point is inside a RigidBody
Example
local tpi = player1.body:testPointInside(0, 1, 0)
if tpi then
print(tpi)
end
- R3d.Body
- R3d.Body.DYNAMIC BODY
- R3d.Body.KINEMATIC BODY
- R3d.Body.STATIC BODY
- R3d.Body:applyLocalForceAtCenterOfMass
- R3d.Body:applyLocalForceAtLocalPosition
- R3d.Body:applyLocalForceAtWorldPosition
- R3d.Body:applyLocalTorque
- R3d.Body:applyWorldForceAtCenterOfMass
- R3d.Body:applyWorldForceAtLocalPosition
- R3d.Body:applyWorldForceAtWorldPosition
- R3d.Body:applyWorldTorque
- R3d.Body:createFixture
- R3d.Body:destroyFixture
- R3d.Body:enableGravity
- R3d.Body:getAngularDamping
- R3d.Body:getAngularLockAxisFactor
- R3d.Body:getAngularVelocity
- R3d.Body:getForce
- R3d.Body:getLinearDamping
- R3d.Body:getLinearLockAxisFactor
- R3d.Body:getLinearVelocity
- R3d.Body:getMass
- R3d.Body:getTorque
- R3d.Body:getTransform
- R3d.Body:raycast
- R3d.Body:resetForce
- R3d.Body:resetTorque
- R3d.Body:setAngularDamping
- R3d.Body:setAngularLockAxisFactor
- R3d.Body:setAngularVelocity
- R3d.Body:setIsActive
- R3d.Body:setIsAllowedToSleep
- R3d.Body:setIsSleeping
- R3d.Body:setLinearDamping
- R3d.Body:setLinearLockAxisFactor
- R3d.Body:setLinearVelocity
- R3d.Body:setMass
- R3d.Body:setSprite
- R3d.Body:setTransform
- R3d.Body:setType
- R3d.Body:testPointInside
- R3d.Body:updateMassPropertiesFromColliders