Tizen 2.1 base
[platform/upstream/libbullet.git] / Extras / PhysicsEffects / include / physics_effects / base_level / collision / pfx_sub_data.h
1 /*\r
2 Physics Effects Copyright(C) 2010 Sony Computer Entertainment Inc.\r
3 All rights reserved.\r
4 \r
5 Physics Effects is open software; you can redistribute it and/or\r
6 modify it under the terms of the BSD License.\r
7 \r
8 Physics Effects is distributed in the hope that it will be useful,\r
9 but WITHOUT ANY WARRANTY; without even the implied warranty of\r
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r
11 See the BSD License for more details.\r
12 \r
13 A copy of the BSD License is distributed with\r
14 Physics Effects under the filename: physics_effects_license.txt\r
15 */\r
16 \r
17 #ifndef _SCE_PFX_SUB_DATA_H\r
18 #define _SCE_PFX_SUB_DATA_H\r
19 \r
20 namespace sce {\r
21 namespace PhysicsEffects {\r
22 \r
23 struct PfxSubData {\r
24         enum {\r
25                 NONE = 0,\r
26                 MESH_INFO\r
27         };\r
28 \r
29         union {\r
30                 struct {\r
31                         PfxUInt8  m_type;\r
32                         SCE_PFX_PADDING(1,1)\r
33 \r
34                         struct {\r
35                                 PfxUInt8  islandId;\r
36                                 PfxUInt8  facetId;\r
37                                 PfxUInt16 s;\r
38                                 PfxUInt16 t;\r
39 \r
40                         } m_facetLocal;\r
41                 };\r
42                 PfxUInt32 param[2];\r
43         };\r
44 \r
45         PfxSubData()\r
46         {\r
47                 param[0] = param[1] = 0;\r
48         }\r
49 \r
50         void  setIslandId(PfxUInt8 i) {m_facetLocal.islandId = i;}\r
51         void  setFacetId(PfxUInt8 i) {m_facetLocal.facetId = i;}\r
52         void  setFacetLocalS(PfxFloat s) {m_facetLocal.s = (PfxUInt16)(s * 65535.0f);}\r
53         void  setFacetLocalT(PfxFloat t) {m_facetLocal.t = (PfxUInt16)(t * 65535.0f);}\r
54 \r
55         PfxUInt8 getIslandId() {return m_facetLocal.islandId;}\r
56         PfxUInt8 getFacetId() {return m_facetLocal.facetId;}\r
57         PfxFloat getFacetLocalS() {return m_facetLocal.s / 65535.0f;}\r
58         PfxFloat getFacetLocalT() {return m_facetLocal.t / 65535.0f;}\r
59 };\r
60 \r
61 } //namespace PhysicsEffects\r
62 } //namespace sce\r
63 #endif // _SCE_PFX_SUB_DATA_H\r