Click or drag to resize

MeshesTranslateMesh Method

Translates meshes' vertices.

Namespace:  KSPDev.ModelUtils
Assembly:  KSPDev_Utils.2.5 (in KSPDev_Utils.2.5.dll) Version: 2.5 for KSP v1
Syntax
C#
public static void TranslateMesh(
	GameObject model,
	Vector3? offset = null,
	Quaternion? rotation = null,
	Vector3? scale = null
)
Request Example View Source

Parameters

model
Type: UnityEngineGameObject
Model object to change the mesh in.
offset (Optional)
Type: SystemNullableVector3
Offset for the vertices. If not specified then the offset is zero. The offset is added after the scale and the rotation have been applied.
rotation (Optional)
Type: SystemNullableQuaternion
Rotation for the vertices. If not set then no rotation is added.
scale (Optional)
Type: SystemNullableVector3
Scale for the vertex positions. If not specified then the scale is not affected.
Remarks
This is different from setting position, rotation and scale to the transform. This method actually changes vertices in the mesh. It's not performance effective, so avoid doing it frequently.
See Also