Skip to content

Commit e856899

Browse files
authored
Merge pull request #681 from threedworld-mit/teleport_use_centroid
Added optional parameter use_centroid to teleport_object and teleport_object_by
2 parents 69b024d + ae42682 commit e856899

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

Documentation/Changelog.md

+10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44

55
To upgrade from TDW v1.11 to v1.12, read [this guide](upgrade_guides/v1.11_to_v1.12.md).
66

7+
## v1.12.24
8+
9+
### Command API
10+
11+
#### Modified Commands
12+
13+
| Command | Modification |
14+
| --- | --- |
15+
| `teleport_object`<br>`teleport_object_by` | Added optional parameter `use_centroid`. |
16+
717
## v1.12.23
818

919
### Command API

Documentation/api/command_api.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -5041,14 +5041,15 @@ Teleport an object to a new position.
50415041
```
50425042

50435043
```python
5044-
{"$type": "teleport_object", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1, "physics": False, "absolute": True}
5044+
{"$type": "teleport_object", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1, "physics": False, "absolute": True, "use_centroid": False}
50455045
```
50465046

50475047
| Parameter | Type | Description | Default |
50485048
| --- | --- | --- | --- |
50495049
| `"position"` | Vector3 | New position of the object. | |
50505050
| `"physics"` | bool | This should almost always be False (the default). If True, apply a "physics-based" teleportation to the object. This only works if the object has a rigidbody (i.e. is a model from a model library) and is slightly slower than a non-physics teleport. Set this to True only if you are having persistent and rare physics glitches. | False |
5051-
| `"absolute"` | bool | If True, set the position in world coordindate space. If False, set the position in local coordinate space. | True |
5051+
| `"absolute"` | bool | If True, set the position in world coordinate space. If False, set the position in local coordinate space. | True |
5052+
| `"use_centroid"` | bool | If True, teleport from the centroid of the object instead of the pivot. | False |
50525053
| `"id"` | int | The unique object ID. | |
50535054

50545055
***
@@ -5063,13 +5064,14 @@ Translate an object by an amount, optionally in local or world space.
50635064
```
50645065

50655066
```python
5066-
{"$type": "teleport_object_by", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1, "absolute": True}
5067+
{"$type": "teleport_object_by", "position": {"x": 1.1, "y": 0.0, "z": 0}, "id": 1, "absolute": True, "use_centroid": False}
50675068
```
50685069

50695070
| Parameter | Type | Description | Default |
50705071
| --- | --- | --- | --- |
50715072
| `"position"` | Vector3 | The positional offset. | |
5072-
| `"absolute"` | bool | If True, set the position in world coordindate space. If False, set the position in local coordinate space. | True |
5073+
| `"absolute"` | bool | If True, set the position in world coordinate space. If False, set the position in local coordinate space. | True |
5074+
| `"use_centroid"` | bool | If True, teleport from the centroid of the object instead of the pivot. | False |
50735075
| `"id"` | int | The unique object ID. | |
50745076

50755077
***

Python/tdw/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.12.23.0"
1+
__version__ = "1.12.24.0"

0 commit comments

Comments
 (0)