Jump to content

Get Position: Difference between revisions

m
Reverted edit by TheRedGuy "the red guy real" (talk) to last revision by Osmo
(Created page with "Given an object, outputs its position and rotation. If the pink input is unwired, outputs the position of the block itself (or the block it is inside). Specifically, it gives the position of the object's center of mass. /uploads/Get Position.png Category:Blocks ")
 
m (Reverted edit by TheRedGuy "the red guy real" (talk) to last revision by Osmo)
Tags: Rollback Mobile edit Mobile web edit Advanced mobile edit
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Given an object, outputs its position and rotation. If the pink input is unwired, outputs the position of the block itself (or the block it is inside).
{{Block
|image=Get Position.png
|type=s
|folder=objects
|input1={{Port|o}}
|output1={{Port|v|Position}}
|output2={{Port|r}}
}}


Specifically, it gives the position of the object's center of mass.
Given an [[object]], outputs its position and rotation. Specifically, it gives the position of the object's center of mass.


[[width=336px|/uploads/Get Position.png]]
== Notes ==


If the input is unwired, output the geometric center of the object it is contained instead, or itself otherwise.
The geometric center is calculated in terms of ''voxels'' instead of blocks, or in other words, the center of the most minimum rectangle that contains every ''voxel'' of said object.
Additional calculations are needed to arrive at the [[geometric center of an object]] (in terms of blocks).
== Related ==
* [[Set Position]]


[[Category:Blocks]]
[[Category:Blocks]]