コード例 #1
0
        /// <summary>
        ///  Draw the drawable mesh; Uses Capture Volume's transform to determine if play space has changed
        ///  Animated meshes are set to redraw every frame while statics only redrawn on them or the volume
        ///  changing transform.
        ///  </summary>
        public void DrawMesh(ref voxie_frame_t vf, Transform voxieCameraTransform)
        {
            if (isSkinnedMesh)
            {
                gameObject.GetComponent <SkinnedMeshRenderer>().BakeMesh(Umesh);
            }

            if (isSkinnedMesh || voxieCameraTransform.hasChanged || transform.hasChanged)
            {
                BuildMesh(voxieCameraTransform);
            }


            for (int mesh = 0; mesh < submesh_n; mesh++)
            {
                if (Umaterials[mesh].mainTexture)
                {
                    voxie_drawmeshtex(ref vf, ref textures[mesh], vt, vtn, tris[mesh], tri_n[mesh], draw_flags, cols[mesh]);
                }
                else
                {
                    voxie_drawmeshtex(ref vf, 0, vt, vtn, tris[mesh], tri_n[mesh], draw_flags, cols[mesh]);
                }
            }
        }
コード例 #2
0
        /// <summary>
        ///  Draw the drawable mesh; Uses Capture Volume's transform to determine if play space has changed
        ///  Animated meshes are set to redraw every frame while statics only redrawn on them or the volume
        ///  changing transform.
        ///  </summary>
        public void DrawMesh(ref voxie_frame_t vf, Transform voxieCameraTransform)
        {
            try
            {
                if (!gameObject.activeSelf)
                {
                    return;
                }

                Profiler.BeginSample("Bake Mesh");
                if (isSkinnedMesh)
                {
                    gameObject.GetComponent <SkinnedMeshRenderer>().BakeMesh(Umesh);
                }
                Profiler.EndSample();

                Profiler.BeginSample("Build Mesh");
                if (isSkinnedMesh || voxieCameraTransform.hasChanged || transform.hasChanged)
                {
                    BuildMesh(voxieCameraTransform);
                }
                Profiler.EndSample();

                for (int mesh = 0; mesh < submesh_n; mesh++)
                {
                    if (Umaterials[mesh].mainTexture)
                    {
                        Profiler.BeginSample("Draw Textured Mesh");
                        if (isSkinnedMesh)
                        {
                            voxie_drawmeshtex(ref vf, ref textures[mesh], vt, vtn, tris[mesh], tri_n[mesh], draw_flags, 0x3F3F3F);
                        }
                        else
                        {
                            voxie_drawmeshtex(ref vf, ref textures[mesh], vt, vtn, tris[mesh], tri_n[mesh], draw_flags, 0x3F3F3F);
                        }
                        Profiler.EndSample();
                    }
                    else
                    {
                        Profiler.BeginSample("Draw UnTextured Mesh");
                        if (isSkinnedMesh)
                        {
                            voxie_drawmeshtex(ref vf, 0, vt, vtn, tris[mesh], tri_n[mesh], draw_flags, GetComponent <SkinnedMeshRenderer>().materials[mesh].color.toInt());
                        }
                        else
                        {
                            voxie_drawmeshtex(ref vf, 0, vt, vtn, tris[mesh], tri_n[mesh], draw_flags, GetComponent <MeshRenderer>().materials[mesh].color.toInt());
                        }
                        Profiler.EndSample();
                    }
                }
            }
            catch (Exception E)
            {
                ExceptionHandler("Error while Drawing " + gameObject.name, E);
            }
        }
コード例 #3
0
        public void Draw(ref voxie_frame_t vf, Transform voxieCameraTransform)
        {
            if (m_Particles != null)
            {
                n_Particles = ps.GetParticles(m_Particles);

                Vector3 l;

                foreach (var par in m_Particles)
                {
                    float size = par.GetCurrentSize(ps) / 50;

                    l = Matrix * par.position;
                    voxie_drawbox(ref vf, l.x - size, -l.y, l.z - size, l.x + size, -l.y, l.z + size, 2, (par.GetCurrentColor(ps)).toInt());
                }
            }
        }
コード例 #4
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 protected static extern void voxie_printalph(ref voxie_frame_t vf, ref point3d p, ref point3d r, ref point3d d,
                                              int col, [MarshalAs(UnmanagedType.LPStr)] string st);
コード例 #5
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 protected static extern void voxie_drawcube(ref voxie_frame_t vf, ref point3d p, ref point3d r, ref point3d d,
                                             ref point3d f, int fillmode, int col);
コード例 #6
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 protected static extern void voxie_drawcone(ref voxie_frame_t vf, float x0, float y0, float z0, float r0, float x1,
                                             float y1, float z1, float r1, int issol, int col);
コード例 #7
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 protected static extern int voxie_drawspr(ref voxie_frame_t vf, [MarshalAs(UnmanagedType.LPStr)] string st,
                                           ref point3d p, ref point3d r, ref point3d d, ref point3d f, int col);
コード例 #8
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 [DllImport("voxiebox", CallingConvention = CallingConvention.Cdecl)] protected extern static void   voxie_drawmesh(ref voxie_frame_t vf, ref point3d pt, int ptn, ref int mesh, int meshn, int fillmode, int col);
コード例 #9
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 protected static extern void voxie_drawsph(ref voxie_frame_t vf, float fx, float fy, float fz, float rad,
                                            int issol, int col);
コード例 #10
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 protected static extern void voxie_setview(ref voxie_frame_t vf, float x0, float y0, float z0, float x1, float y1,
                                            float z1);
コード例 #11
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 protected static extern void voxie_drawvox(ref voxie_frame_t vf, float fx, float fy, float fz, int col);
コード例 #12
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 protected static extern void voxie_drawmesh(ref voxie_frame_t vf, point3dcol_t[] vt, int vtn, int[] mesh, int meshn, int fillmode, int col);
コード例 #13
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 protected static extern void voxie_drawmeshtex(ref voxie_frame_t vf, ref tiletype texture, poltex_t[] vt, int vtn, int[] mesh, int meshn,
                                                int flags, int col);
コード例 #14
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 protected static extern void voxie_drawpol(ref voxie_frame_t vf, ref pol_t pt, int n, int col);
コード例 #15
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 protected static extern void voxie_drawlin(ref voxie_frame_t vf, float x0, float y0, float z0, float x1, float y1,
                                            float z1, int col);
コード例 #16
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 protected static extern void voxie_drawbox(ref voxie_frame_t vf, float x0, float y0, float z0, float x1, float y1,
                                            float z1, int fillmode, int col);
コード例 #17
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 protected static extern float voxie_drawheimap(ref voxie_frame_t vf, [MarshalAs(UnmanagedType.LPStr)] string st,
                                                ref point3d p, ref point3d r, ref point3d d, ref point3d f, int colorkey, int heimin, int flags);
コード例 #18
0
 protected static extern void voxie_printalph(ref voxie_frame_t vf, ref point3d p, ref point3d r, ref point3d d,
                                              int col, byte[] st);
コード例 #19
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 protected static extern void voxie_drawmeshtex(ref voxie_frame_t vf, int nullptr, poltex_t[] vt, int vtn, int[] mesh, int meshn,
                                                int flags, int col);
コード例 #20
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 protected static extern int voxie_frame_start(ref voxie_frame_t vf);
コード例 #21
0
 /// <summary>
 ///  Draw the drawable mesh; Uses Capture Volume's transform to determine if play space has changed
 ///  Animated meshes are set to redraw every frame while statics only redrawn on them or the volume
 ///  changing transform.
 ///  </summary>
 public void DrawMesh(ref voxie_frame_t vf, Transform voxieCameraTransform)
 {
     voxie_printalph(ref vf, ref pp, ref pr, ref pd, 0xffffff, ts);
 }
コード例 #22
0
ファイル: VoxieHelper.cs プロジェクト: DennisVinke/TcpTest
 [DllImport("voxiebox", CallingConvention = CallingConvention.Cdecl)] protected extern static void   voxie_drawpol(ref voxie_frame_t vf, ref tri_t tri, int n, int col);