Click or drag to resize

CollidersAdjustCollider Method

Adds or adjusts a primitive collider on the mesh.

Namespace:  KSPDev.ModelUtils
Assembly:  KSPDev_Utils.2.5 (in KSPDev_Utils.2.5.dll) Version: 2.5 for KSP v1
Syntax
C#
public static Collider AdjustCollider(
	GameObject primitive,
	Vector3 meshSize,
	CollidersPrimitiveCollider colliderType,
	PrimitiveType? shapeType = null
)
Request Example View Source

Parameters

primitive
Type: UnityEngineGameObject
The primitive game object to adjust.
meshSize
Type: UnityEngineVector3
The size of the collider in local units. Depending on shapeType the meaning of the components is different. If the shape has a "round" component, then it's a "diameter" in this vector.
colliderType
Type: KSPDev.ModelUtilsCollidersPrimitiveCollider
Determines how a collider type should be selected.
shapeType (Optional)
Type: SystemNullablePrimitiveType
The type of the primitive when colliderType is Shape. It will determine the type of the collider. Only Cylinder, Sphere, and Cube are supported.

Return Value

Type: Collider
The adjusted collider.
Remarks
Type of the primitive collider is chosen basing on the primitive type.
See Also