summaryrefslogtreecommitdiff
path: root/doc/classes/PhysicsShapeQueryParameters3D.xml
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-11-16 09:16:18 +0100
committerGitHub <noreply@github.com>2020-11-16 09:16:18 +0100
commit91dd6da2ffceb10d768fdd4be4b11c2c31f0b0c8 (patch)
tree6570640636e41c4e473c6670def4b73360e54a02 /doc/classes/PhysicsShapeQueryParameters3D.xml
parentf763a2a3db509127df2eefee574b83e9b5eb9677 (diff)
parenta3df26e5541905572c35791f2f10c6086c52e32d (diff)
Merge pull request #43246 from HaSa1002/docs-lang-5
Docs: Port code examples to C# (M, N, O, P, Q, R)
Diffstat (limited to 'doc/classes/PhysicsShapeQueryParameters3D.xml')
-rw-r--r--doc/classes/PhysicsShapeQueryParameters3D.xml35
1 files changed, 25 insertions, 10 deletions
diff --git a/doc/classes/PhysicsShapeQueryParameters3D.xml b/doc/classes/PhysicsShapeQueryParameters3D.xml
index 167fb31bb3..4b43ea66fc 100644
--- a/doc/classes/PhysicsShapeQueryParameters3D.xml
+++ b/doc/classes/PhysicsShapeQueryParameters3D.xml
@@ -31,19 +31,34 @@
</member>
<member name="shape_rid" type="RID" setter="set_shape_rid" getter="get_shape_rid">
The queried shape's [RID] that will be used for collision/intersection queries. Use this over [member shape] if you want to optimize for performance using the Servers API:
- [codeblock]
- var shape_rid = PhysicsServer3D.shape_create(PhysicsServer3D.SHAPE_SPHERE)
- var radius = 2.0
- PhysicsServer3D.shape_set_data(shape_rid, radius)
+ [codeblocks]
+ [gdscript]
+ var shape_rid = PhysicsServer3D.shape_create(PhysicsServer3D.SHAPE_SPHERE)
+ var radius = 2.0
+ PhysicsServer3D.shape_set_data(shape_rid, radius)
- var params = PhysicsShapeQueryParameters3D.new()
- params.shape_rid = shape_rid
+ var params = PhysicsShapeQueryParameters3D.new()
+ params.shape_rid = shape_rid
- # Execute physics queries here...
+ # Execute physics queries here...
- # Release the shape when done with physics queries.
- PhysicsServer3D.free_rid(shape_rid)
- [/codeblock]
+ # Release the shape when done with physics queries.
+ PhysicsServer3D.free_rid(shape_rid)
+ [/gdscript]
+ [csharp]
+ RID shapeRid = PhysicsServer3D.ShapeCreate(PhysicsServer3D.ShapeType.Sphere);
+ float radius = 2.0f;
+ PhysicsServer3D.ShapeSetData(shapeRid, radius);
+
+ var params = new PhysicsShapeQueryParameters3D();
+ params.ShapeRid = shapeRid;
+
+ // Execute physics queries here...
+
+ // Release the shape when done with physics queries.
+ PhysicsServer3D.FreeRid(shapeRid);
+ [/csharp]
+ [/codeblocks]
</member>
<member name="transform" type="Transform" setter="set_transform" getter="get_transform" default="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )">
The queried shape's transform matrix.