コード例 #1
0
        protected override bool ShouldGenerateNewMesh(BaseShape.Model newModel)
        {
            if (currentMesh == null)
            {
                return(true);
            }

            Model newPlaneModel = newModel as Model;

            if (newPlaneModel.uvs != null && model.uvs != null)
            {
                if (newPlaneModel.uvs.Length != model.uvs.Length)
                {
                    return(true);
                }

                for (int i = 0; i < newPlaneModel.uvs.Length; i++)
                {
                    if (newPlaneModel.uvs[i] != model.uvs[i])
                    {
                        return(true);
                    }
                }
            }
            else
            {
                if (newPlaneModel.uvs != model.uvs)
                {
                    return(true);
                }
            }

            return(newPlaneModel.width != model.width || newPlaneModel.height != model.height);
        }
コード例 #2
0
ファイル: BoxShape.cs プロジェクト: endel/explorer
        protected override bool ShouldGenerateNewMesh(BaseShape.Model previousModel)
        {
            if (currentMesh == null)
            {
                return(true);
            }

            BoxShape.Model newBoxModel = (BoxShape.Model) this.model;
            BoxShape.Model oldBoxModel = (BoxShape.Model)previousModel;

            if (newBoxModel.uvs != null && oldBoxModel.uvs != null)
            {
                if (newBoxModel.uvs.Length != oldBoxModel.uvs.Length)
                {
                    return(true);
                }

                for (int i = 0; i < newBoxModel.uvs.Length; i++)
                {
                    if (newBoxModel.uvs[i] != oldBoxModel.uvs[i])
                    {
                        return(true);
                    }
                }
            }
            else
            {
                if (newBoxModel.uvs != oldBoxModel.uvs)
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #3
0
        protected override bool ShouldGenerateNewMesh(BaseShape.Model newModel)
        {
            if (currentMesh == null)
            {
                return(true);
            }

            Model newCylinderModel = newModel as Model;

            return(newCylinderModel.radius != model.radius ||
                   newCylinderModel.radiusTop != model.radiusTop ||
                   newCylinderModel.radiusBottom != model.radiusBottom ||
                   newCylinderModel.segmentsHeight != model.segmentsHeight ||
                   newCylinderModel.segmentsRadial != model.segmentsRadial ||
                   newCylinderModel.openEnded != model.openEnded ||
                   newCylinderModel.arc != model.arc);
        }
コード例 #4
0
ファイル: BoxShape.cs プロジェクト: KiichiSugihara/explorer
 protected override bool ShouldGenerateNewMesh(BaseShape.Model newModel)
 {
     return(currentMesh == null);
 }
コード例 #5
0
 protected virtual bool ShouldGenerateNewMesh(BaseShape.Model newModel)
 {
     return(true);
 }