# Shape.transformRotation

Transform a world rotation to the local shape transform.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
shape:transformRotation( quat )
```

[Open the full Game reference](../Game-Script-Environment/Userdata/Shape.md#transformrotation)

```lua
local worldUp = sm.vec3.new( 0, 0, 1 )
local worldRot = sm.vec3.getRotation( worldUp, worldDir )
local localRot = self.shape:transformRotation( worldRot )
```

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `shape` | [Shape](../Game-Script-Environment/Userdata/Shape.md) | The shape. |
| `quat` | [Quat](../Game-Script-Environment/Userdata/Quat.md) | The untransformed quaternion. |

**Returns:**

| Type | Description |
| --- | --- |
| [Quat](../Game-Script-Environment/Userdata/Quat.md) | The transformed quaternion. |
