Node.GlobalTransform

Node.GlobalTransform property

获取全局变换。

public GlobalTransform GlobalTransform { get; }

Property Value

全局变换。

示例

以下代码展示了如何读取节点的全局变换

Scene scene = new Scene();
var boxNode = scene.RootNode.CreateChildNode(new Box());
//将盒子放置在 (10, 0, 0) 处
boxNode.Transform.Translation = new Vector3(10, 0, 0);
var global = boxNode.GlobalTransform;
Console.WriteLine($"The box's position in world coordinate is {global.Translation}");

另请参见