109#define NUM_BOX_VERTS 8
110#define NUM_BOX_FACES 12
356 _BoxMaterial->Set_Ambient(0,0,0);
357 _BoxMaterial->Set_Diffuse(0,0,0);
358 _BoxMaterial->Set_Specular(0,0,0);
359 _BoxMaterial->Set_Emissive(1,1,1);
360 _BoxMaterial->Set_Opacity(1.0f);
361 _BoxMaterial->Set_Shininess(0.0f);
453 verts[ivert].
X = center.
X + _BoxVerts[ivert][0] * extent.
X;
454 verts[ivert].
Y = center.
Y + _BoxVerts[ivert][1] * extent.
Y;
455 verts[ivert].
Z = center.
Z + _BoxVerts[ivert][2] * extent.
Z;
479 vb->
nx=_BoxVertexNormals[i][0];
480 vb->
ny=_BoxVertexNormals[i][1];
481 vb->
nz=_BoxVertexNormals[i][2];
498 indices[3*i] = _BoxFaces[i][0];
499 indices[3*i+1] = _BoxFaces[i][1];
500 indices[3*i+2] = _BoxFaces[i][2];
544 verts[ivert].
X = center.
X + _BoxVerts[ivert][0] * extent.
X;
545 verts[ivert].
Y = center.
Y + _BoxVerts[ivert][1] * extent.
Y;
546 verts[ivert].
Z = center.
Z + _BoxVerts[ivert][2] * extent.
Z;
1033 if (
this != &that) {
1351 cload.
Read(&box,
sizeof(box));
1365 return Definition.
Name;
#define W3D_BOX_ATTRIBUTE_COLLISION_TYPE_SHIFT
#define W3D_BOX_ATTRIBUTE_ORIENTED
#define W3D_BOX_ATTRIBUTE_COLLISION_TYPE_MASK
BoxLoaderClass _BoxLoader
WWINLINE void Init(const Vector3 ¢er, const Vector3 &extent)
virtual void Get_Obj_Space_Bounding_Sphere(SphereClass &sphere) const
virtual bool Intersect_AABox(AABoxIntersectionTestClass &boxtest)
virtual void Special_Render(SpecialRenderInfoClass &rinfo)
virtual void update_cached_box(void)
virtual void Set_Position(const Vector3 &v)
virtual bool Intersect_OBBox(OBBoxIntersectionTestClass &boxtest)
virtual RenderObjClass * Clone(void) const
virtual void Get_Obj_Space_Bounding_Box(AABoxClass &box) const
AABoxRenderObjClass & operator=(const AABoxRenderObjClass &)
virtual bool Cast_Ray(RayCollisionTestClass &raytest)
virtual void Set_Transform(const Matrix3D &m)
virtual void Render(RenderInfoClass &rinfo)
AABoxRenderObjClass(void)
virtual bool Cast_OBBox(OBBoxCollisionTestClass &boxtest)
virtual int Class_ID(void) const
virtual bool Cast_AABox(AABoxCollisionTestClass &boxtest)
virtual PrototypeClass * Load_W3D(ChunkLoadClass &cload)
virtual const char * Get_Name(void) const
BoxPrototypeClass(W3dBoxStruct box)
virtual RenderObjClass * Create(void)
virtual int Get_Class_ID(void) const
char Name[2 *W3D_NAME_LEN]
void Set_Color(const Vector3 &color)
virtual int Get_Num_Polys(void) const
static int Get_Box_Display_Mask(void)
virtual void Set_Name(const char *name)
static void Shutdown(void)
void render_box(RenderInfoClass &rinfo, const Vector3 ¢er, const Vector3 &extent)
BoxRenderObjClass & operator=(const BoxRenderObjClass &)
void vis_render_box(SpecialRenderInfoClass &rinfo, const Vector3 ¢er, const Vector3 &extent)
static void Set_Box_Display_Mask(int mask)
virtual const char * Get_Name(void) const
uint32 Read(void *buf, uint32 nbytes)
static bool Collide(const LineSegClass &line, const AAPlaneClass &plane, CastResultStruct *result)
static bool Intersection_Test(const AABoxClass &box, const TriClass &tri)
CastResultStruct * Result
RenderObjClass * CollidedRenderObj
static void Set_Vertex_Buffer(const VertexBufferClass *vb, unsigned stream=0)
static void Set_Texture(unsigned stage, TextureBaseClass *texture)
static void Set_Index_Buffer(const IndexBufferClass *ib, unsigned short index_base_offset)
static Vector4 Convert_Color(unsigned color)
static void Draw_Triangles(unsigned buffer_type, unsigned short start_index, unsigned short polygon_count, unsigned short min_vertex_index, unsigned short vertex_count)
static void Set_Material(const VertexMaterialClass *material)
static void Set_Shader(const ShaderClass &shader)
static void Set_Transform(D3DTRANSFORMSTATETYPE transform, const Matrix4x4 &m)
unsigned short * Get_Index_Array()
VertexFormatXYZNDUV2 * Get_Formatted_Vertex_Array()
void Translate(float x, float y, float z)
static WWINLINE void Transform_Vector(const Matrix3D &tm, const Vector3 &in, Vector3 *out)
virtual bool Cast_AABox(AABoxCollisionTestClass &boxtest)
OBBoxClass & Get_Box(void)
virtual void Set_Transform(const Matrix3D &m)
virtual void Get_Obj_Space_Bounding_Sphere(SphereClass &sphere) const
virtual void Render(RenderInfoClass &rinfo)
virtual void Special_Render(SpecialRenderInfoClass &rinfo)
virtual void Set_Position(const Vector3 &v)
virtual bool Intersect_OBBox(OBBoxIntersectionTestClass &boxtest)
virtual bool Intersect_AABox(AABoxIntersectionTestClass &boxtest)
virtual int Class_ID(void) const
OBBoxRenderObjClass & operator=(const OBBoxRenderObjClass &)
virtual void update_cached_box(void)
OBBoxRenderObjClass(void)
virtual RenderObjClass * Clone(void) const
virtual bool Cast_Ray(RayCollisionTestClass &raytest)
virtual bool Cast_OBBox(OBBoxCollisionTestClass &boxtest)
virtual void Get_Obj_Space_Bounding_Box(AABoxClass &box) const
virtual int Is_Animation_Hidden(void) const
virtual void Set_Transform(const Matrix3D &m)
virtual void Get_Obj_Space_Bounding_Sphere(SphereClass &sphere) const
virtual void Set_Position(const Vector3 &v)
virtual void Set_Collision_Type(int type)
virtual const AABoxClass & Get_Bounding_Box(void) const
RenderObjClass & operator=(const RenderObjClass &)
virtual void Validate_Transform(void) const
virtual int Get_Collision_Type(void) const
static ShaderClass _PresetAlphaSolidShader
VisRasterizerClass * VisRasterizer
void Init(const Vector3 &pos, float radius)
void Set_Model_Transform(const Matrix3D &model)
bool Render_Triangles(const Vector3 *verts, int vcount, const TriIndex *tris, int tcount, const AABoxClass &bounds)
static void Convert_Vector(const W3dVectorStruct &v, Vector3 *set)
static void Convert_Color(const W3dRGBStruct &rgb, Vector3 *set)
const unsigned dynamic_fvf_type
@ BUFFER_TYPE_DYNAMIC_DX8
#define REF_PTR_RELEASE(x)
char Name[2 *W3D_NAME_LEN]