struct T3dobject//object Information structure body
{
int numofverts; Number of vertices in the model
The number of polygons in the int numoffaces;//model
The number of texture coordinates in the int numtexvertex;//model
int materialid; Texture ID
Whether bool bhastexture;//has texture mapping
BOOL bvisible;//object is visible, default is visible
Char strname[255];//the name of the object
FPoint3 vertex of *pverts;//object
Normal vector of FPoint3 *pnormals;//vertices
FPoint2 *ptexverts;//Texture UV coordinates
Tface Polygon information for *pfaces;//objects
FPoint3 normal of *pfacenormals;//face
Overloading the t3dobject operator
t3dobject& operator= (t3dobject& value)
{
Numofverts = Value.numofverts; Number of vertices in the model
numoffaces = number of polygons in the value.numoffaces;//model
Numtexvertex = number of texture coordinates in the value.numtexvertex;//model
Materialid = Value.materialid; Texture ID
Bhastexture = value.bhastexture;//Whether there is a texture map
Bvisible = value.bvisible;//object is visible, default is visible
Char strname[255];//the name of the object
Pverts = vertex of value.pverts;//object
Pnormals = Normal vector of value.pnormals;//vertices
Ptexverts = value.ptexverts;//Texture UV coordinates
Pfaces = Polygon information for value.pfaces;//objects
Pfacenormals = Normals of value.pfacenormals;//faces
return *this;
}
};
When a struct contains a struct, the assignment is complex and prone to problems, so it's best to use a pointer to pass it.
! struct operator Reload