public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim)
{
BSShape ret;
// If the underlying shape is native, the actual shape has not been build (waiting for asset)
// and we must create a copy of the native shape since they are never shared.
if (physShapeInfo.HasPhysicalShape && physShapeInfo.isNativeShape)
{
// TODO: decide when the native shapes should be freed, Check in Dereference?
ret = BSShapeNative.GetReference(pPhysicsScene, pPrim, BSPhysicsShapeType.SHAPE_BOX,
FixedShapeKey.KEY_BOX);
}
else
{
// Another reference to this hsape is just counted.
IncrementReference();
ret = this;
}
return ret;
}