MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / getByteSize

Function getByteSize

examples/Heightfield/HeightfieldExample.cpp:113–138  ·  view source on GitHub ↗

TODO: it would probably cleaner to have a struct per data type, so you could lookup byte sizes, conversion functions, etc.

Source from the content-addressed store, hash-verified

111// TODO: it would probably cleaner to have a struct per data type, so
112// you could lookup byte sizes, conversion functions, etc.
113static int getByteSize
114(
115 PHY_ScalarType type
116)
117{
118 int size = 0;
119
120 switch (type) {
121 case PHY_FLOAT:
122 size = sizeof(btScalar);
123 break;
124
125 case PHY_UCHAR:
126 size = sizeof(unsigned char);
127 break;
128
129 case PHY_SHORT:
130 size = sizeof(short);
131 break;
132
133 default:
134 btAssert(!"Bad heightfield data type");
135 }
136
137 return size;
138}
139
140
141

Callers 3

getGridHeightFunction · 0.85
getRawHeightfieldDataFunction · 0.85
stepSimulationMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected