Ejemplo n.º 1
0
    // -- SpringheadのShapeオブジェクトを構築する
    public override CDShapeIf CreateShape(GameObject shapeObject)
    {
        MeshRoundCone mrc = shapeObject.GetComponent <MeshRoundCone>();

        if (mrc == null)
        {
            throw new ObjectNotFoundException("CDRoundConeBehaviour requires MeshRoundCone", shapeObject);
        }

        desc.radius = new Vec2f(mrc.r1, mrc.r2);
        desc.length = mrc.length;

        return(phSdk.CreateShape(CDRoundConeIf.GetIfInfoStatic(), (CDRoundConeDesc)desc));
    }
Ejemplo n.º 2
0
    // -- SpringheadのShapeオブジェクトを構築する
    public override CDShapeIf CreateShape(GameObject shapeObject)
    {
        MeshRoundCone mrc = shapeObject.GetComponent <MeshRoundCone>();

        if (mrc == null)
        {
            throw new ObjectNotFoundException("CDRoundConeBehaviour requires MeshRoundCone", shapeObject);
        }

        Vector3 scale = shapeObject.transform.lossyScale;

        desc.radius = new Vec2f(mrc.r1, mrc.r2) * (Mathf.Max(scale.x, scale.z));
        desc.length = mrc.length * scale.y;

        return(phSdk.CreateShape(CDRoundConeIf.GetIfInfoStatic(), (CDRoundConeDesc)desc));
    }