コード例 #1
0
        private Mesh loadCameraSpawn(SpawnInfo.BaseSpawn spawn)
        {
            SpawnInfo.CameraSpawn tempbox;
            tempbox = spawn as SpawnInfo.CameraSpawn;

            try
            {
                return(Mesh.Cylinder(render.device, 0.1f, 2.0f, 10f, 10, 10));
            }
            catch (Exception ex)
            {
                Global.ShowErrorMsg("Failure to create Bounding Box Mesh for [" + tempbox.TagType + "] " + tempbox.TagPath, ex);
            }
            return(null);
        }
コード例 #2
0
 private Mesh loadSpawnZone(SpawnInfo.BaseSpawn spawn)
 {
     SpawnInfo.SpawnZone tempCylinder = spawn as SpawnInfo.SpawnZone;
     // Used for fixing position of bounding boxes
     tempCylinder.bbXDiff = 0;
     tempCylinder.bbYDiff = 0;
     tempCylinder.bbZDiff = tempCylinder.UpperHeight - (tempCylinder.UpperHeight - tempCylinder.LowerHeight) / 2;
     return(Mesh.Cylinder(
                render.device,
                tempCylinder.InnerRadius,
                tempCylinder.OuterRadius,
                tempCylinder.UpperHeight - tempCylinder.LowerHeight,
                32,
                5
                ));
 }
コード例 #3
0
 private Mesh loadBoundingBoxSpawn(SpawnInfo.BaseSpawn spawn)
 {
     SpawnInfo.BoundingBoxSpawn tempbox;
     tempbox = spawn as SpawnInfo.BoundingBoxSpawn;
     try
     {
         return(Mesh.Box(render.device, tempbox.width, tempbox.height, tempbox.length));
     }
     catch (Exception ex)
     {
         Global.ShowErrorMsg("Failure to create Bounding Box Mesh for [" + tempbox.TagType + "] " + tempbox.TagPath +
                             "\nWidth : " + tempbox.width.ToString() +
                             "\nHeight: " + tempbox.height.ToString() +
                             "\nLength: " + tempbox.length.ToString(),
                             ex);
     }
     return(null);
 }
コード例 #4
0
        private Mesh loadSoundSpawn(SpawnInfo.BaseSpawn spawn)
        {
            SpawnInfo.SoundSpawn tempbox;
            tempbox = spawn as SpawnInfo.SoundSpawn;
            switch (tempbox.VolumeType)
            {
            case 0:     // Sphere
                if (tempbox.DistanceBoundsLower < 30)
                {
                    return(Mesh.Sphere(
                               render.device,
                               tempbox.DistanceBoundsLower,
                               10 + (int)tempbox.DistanceBoundsLower,
                               10 + (int)tempbox.DistanceBoundsLower));
                }
                else
                {
                    return(Mesh.Sphere(render.device, tempbox.DistanceBoundsLower, 30, 30));
                }

            case 1:     // Cylinder
                return(Mesh.Cylinder(
                           render.device,
                           tempbox.DistanceBoundsLower,
                           tempbox.DistanceBoundsUpper,
                           10 + tempbox.Height,
                           10,
                           10));

            default:
                return(Mesh.Cylinder(
                           render.device,
                           tempbox.DistanceBoundsLower,
                           tempbox.DistanceBoundsUpper,
                           tempbox.Height,
                           10,
                           10));
            }
        }