Difference between revisions of "R3d.Fixture:testPointInside"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 +
__NOTOC__
 
'''Available since:''' Gideros 2019.10<br/>
 
'''Available since:''' Gideros 2019.10<br/>
 
'''Class:''' [[R3d.Fixture]]<br/>
 
'''Class:''' [[R3d.Fixture]]<br/>
  
 
=== Description ===
 
=== Description ===
Checks if a point is inside the fixture.
+
Checks if a 3D point is inside a fixture.
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
r3d.Fixture:testPointInside(x,y,z)
+
(bool) = r3d.Fixture:testPointInside(x,y,z)
</source>
+
</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 on the X axis<br/>
+
'''x''': (number) the position of the point in the x axis world coordinate<br/>
'''y''': (number) the position of the point on the Y axis<br/>
+
'''y''': (number) the position of the point in the y axis world coordinate<br/>
'''z''': (number) the position of the point on the Z axis<br/>
+
'''z''': (number) the position of the point in the z axis world coordinate<br/>
 +
 
 +
=== Return values ===
 +
'''Returns''' (boolean) true if a point is inside a RigidBody<br/>
  
 
=== Example ===
 
=== Example ===
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
</source>
+
local tpi = player1.fixture:testPointInside(0, 1, 0)
 +
if tpi then
 +
print(tpi)
 +
end
 +
</syntaxhighlight>
  
 
{{R3d.Fixture}}
 
{{R3d.Fixture}}

Latest revision as of 01:49, 19 December 2025

Available since: Gideros 2019.10
Class: R3d.Fixture

Description

Checks if a 3D point is inside a fixture.

(bool) = r3d.Fixture: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.fixture:testPointInside(0, 1, 0)
if tpi then
	print(tpi)
end