Universe.Physics.BulletSPlugin.BSLinkset.Factory C# (CSharp) Method

Factory() public static method

public static Factory ( BSScene physScene, BSPrimLinkable parent ) : BSLinkset
physScene BSScene
parent BSPrimLinkable
return BSLinkset
        public static BSLinkset Factory(BSScene physScene, BSPrimLinkable parent)
        {
            BSLinkset ret = null;

            switch (parent.LinksetType)
            {
                case LinksetImplementation.Constraint:
                    ret = new BSLinksetConstraints(physScene, parent);
                    break;
                case LinksetImplementation.Compound:
                    ret = new BSLinksetCompound(physScene, parent);
                    break;
                case LinksetImplementation.Manual:
                    // ret = new BSLinksetManual(physScene, parent);
                    break;
                default:
                    ret = new BSLinksetCompound(physScene, parent);
                    break;
            }
            if (ret == null)
            {
                physScene.Logger.ErrorFormat(
                    "[Bulletsim Linkset] Factory could not create linkset. Parent name={1}, ID={2}", parent.Name,
                    parent.LocalID);
            }
            return ret;
        }

Usage Example

Example #1
0
        public BSPrimLinkable(uint localID, String primName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 size,
                              OMV.Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical, int material, float friction,
                              float restitution, float gravityMultiplier, float density)
            : base(localID, primName, parent_scene, pos, size, rotation, pbs, pisPhysical)
        {
            // Default linkset implementation for this prim
            LinksetType = (BSLinkset.LinksetImplementation)BSParam.LinksetImplementation;

            Linkset = BSLinkset.Factory(PhysicsScene, this);
            if (Linkset != null)
            {
                Linkset.Refresh(this);
            }
        }
All Usage Examples Of Universe.Physics.BulletSPlugin.BSLinkset::Factory