Replace some uint types with uint32 or uint16

This commit is contained in:
Daniel Chappuis 2021-09-01 09:45:58 +02:00
parent 90741a69bb
commit e7a1296de1
4 changed files with 19 additions and 19 deletions

View File

@ -98,10 +98,10 @@ class PhysicsWorld {
bool isSleepingEnabled; bool isSleepingEnabled;
/// Number of iterations when solving the velocity constraints of the Sequential Impulse technique /// Number of iterations when solving the velocity constraints of the Sequential Impulse technique
uint defaultVelocitySolverNbIterations; uint16 defaultVelocitySolverNbIterations;
/// Number of iterations when solving the position constraints of the Sequential Impulse technique /// Number of iterations when solving the position constraints of the Sequential Impulse technique
uint defaultPositionSolverNbIterations; uint16 defaultPositionSolverNbIterations;
/// Time (in seconds) that a body must stay still to be considered sleeping /// Time (in seconds) that a body must stay still to be considered sleeping
float defaultTimeBeforeSleep; float defaultTimeBeforeSleep;
@ -226,7 +226,7 @@ class PhysicsWorld {
#endif #endif
/// Total number of worlds /// Total number of worlds
static uint mNbWorlds; static uint32 mNbWorlds;
/// All the islands of bodies of the current frame /// All the islands of bodies of the current frame
Islands mIslands; Islands mIslands;
@ -246,10 +246,10 @@ class PhysicsWorld {
DynamicsSystem mDynamicsSystem; DynamicsSystem mDynamicsSystem;
/// Number of iterations for the velocity solver of the Sequential Impulses technique /// Number of iterations for the velocity solver of the Sequential Impulses technique
uint mNbVelocitySolverIterations; uint16 mNbVelocitySolverIterations;
/// Number of iterations for the position solver of the Sequential Impulses technique /// Number of iterations for the position solver of the Sequential Impulses technique
uint mNbPositionSolverIterations; uint16 mNbPositionSolverIterations;
/// True if the spleeping technique for inactive bodies is enabled /// True if the spleeping technique for inactive bodies is enabled
bool mIsSleepingEnabled; bool mIsSleepingEnabled;
@ -358,13 +358,13 @@ class PhysicsWorld {
void update(decimal timeStep); void update(decimal timeStep);
/// Get the number of iterations for the velocity constraint solver /// Get the number of iterations for the velocity constraint solver
uint getNbIterationsVelocitySolver() const; uint16 getNbIterationsVelocitySolver() const;
/// Set the number of iterations for the velocity constraint solver /// Set the number of iterations for the velocity constraint solver
void setNbIterationsVelocitySolver(uint nbIterations); void setNbIterationsVelocitySolver(uint16 nbIterations);
/// Get the number of iterations for the position constraint solver /// Get the number of iterations for the position constraint solver
uint getNbIterationsPositionSolver() const; uint16 getNbIterationsPositionSolver() const;
/// Set the number of iterations for the position constraint solver /// Set the number of iterations for the position constraint solver
void setNbIterationsPositionSolver(uint32 nbIterations); void setNbIterationsPositionSolver(uint32 nbIterations);
@ -427,7 +427,7 @@ class PhysicsWorld {
void setEventListener(EventListener* eventListener); void setEventListener(EventListener* eventListener);
/// Return the number of CollisionBody in the physics world /// Return the number of CollisionBody in the physics world
uint getNbCollisionBodies() const; uint32 getNbCollisionBodies() const;
/// Return a constant pointer to a given CollisionBody of the world /// Return a constant pointer to a given CollisionBody of the world
const CollisionBody* getCollisionBody(uint32 index) const; const CollisionBody* getCollisionBody(uint32 index) const;
@ -436,7 +436,7 @@ class PhysicsWorld {
CollisionBody* getCollisionBody(uint32 index) ; CollisionBody* getCollisionBody(uint32 index) ;
/// Return the number of RigidBody in the physics world /// Return the number of RigidBody in the physics world
uint getNbRigidBodies() const; uint32 getNbRigidBodies() const;
/// Return a constant pointer to a given RigidBody of the world /// Return a constant pointer to a given RigidBody of the world
const RigidBody* getRigidBody(uint32 index) const; const RigidBody* getRigidBody(uint32 index) const;
@ -595,7 +595,7 @@ RP3D_FORCE_INLINE Profiler* PhysicsWorld::getProfiler() {
/** /**
* @return The number of iterations of the velocity constraint solver * @return The number of iterations of the velocity constraint solver
*/ */
RP3D_FORCE_INLINE uint PhysicsWorld::getNbIterationsVelocitySolver() const { RP3D_FORCE_INLINE uint16 PhysicsWorld::getNbIterationsVelocitySolver() const {
return mNbVelocitySolverIterations; return mNbVelocitySolverIterations;
} }
@ -603,7 +603,7 @@ RP3D_FORCE_INLINE uint PhysicsWorld::getNbIterationsVelocitySolver() const {
/** /**
* @return The number of iterations of the position constraint solver * @return The number of iterations of the position constraint solver
*/ */
RP3D_FORCE_INLINE uint PhysicsWorld::getNbIterationsPositionSolver() const { RP3D_FORCE_INLINE uint16 PhysicsWorld::getNbIterationsPositionSolver() const {
return mNbPositionSolverIterations; return mNbPositionSolverIterations;
} }

View File

@ -202,8 +202,8 @@ NarrowPhaseAlgorithmType CollisionDispatch::selectNarrowPhaseAlgorithm(const Col
RP3D_PROFILE("CollisionDispatch::selectNarrowPhaseAlgorithm()", mProfiler); RP3D_PROFILE("CollisionDispatch::selectNarrowPhaseAlgorithm()", mProfiler);
uint shape1Index = static_cast<unsigned int>(shape1Type); uint32 shape1Index = static_cast<uint32>(shape1Type);
uint shape2Index = static_cast<unsigned int>(shape2Type); uint shape2Index = static_cast<uint32>(shape2Type);
// Swap the shape types if necessary // Swap the shape types if necessary
if (shape1Index > shape2Index) { if (shape1Index > shape2Index) {

View File

@ -727,7 +727,7 @@ void PhysicsWorld::destroyJoint(Joint* joint) {
/** /**
* @param nbIterations Number of iterations for the velocity solver * @param nbIterations Number of iterations for the velocity solver
*/ */
void PhysicsWorld::setNbIterationsVelocitySolver(uint32 nbIterations) { void PhysicsWorld::setNbIterationsVelocitySolver(uint16 nbIterations) {
mNbVelocitySolverIterations = nbIterations; mNbVelocitySolverIterations = nbIterations;

View File

@ -46,7 +46,7 @@ class TestTriangleVertexArray : public Test {
float mVertices1[4*3]; float mVertices1[4*3];
double mVertices2[4*3]; double mVertices2[4*3];
float mNormals2[4*3]; float mNormals2[4*3];
uint mIndices1[6]; uint32 mIndices1[6];
short mIndices2[6]; short mIndices2[6];
TriangleVertexArray* mTriangleVertexArray1; TriangleVertexArray* mTriangleVertexArray1;
TriangleVertexArray* mTriangleVertexArray2; TriangleVertexArray* mTriangleVertexArray2;
@ -114,7 +114,7 @@ class TestTriangleVertexArray : public Test {
// Create triangle vertex array with automatic normals computation // Create triangle vertex array with automatic normals computation
mTriangleVertexArray1 = new TriangleVertexArray(4, static_cast<const void*>(mVertices1), 3 * sizeof(float), mTriangleVertexArray1 = new TriangleVertexArray(4, static_cast<const void*>(mVertices1), 3 * sizeof(float),
2, static_cast<const void*>(mIndices1), 3 * sizeof(uint), 2, static_cast<const void*>(mIndices1), 3 * sizeof(uint32),
TriangleVertexArray::VertexDataType::VERTEX_FLOAT_TYPE, TriangleVertexArray::VertexDataType::VERTEX_FLOAT_TYPE,
TriangleVertexArray::IndexDataType::INDEX_INTEGER_TYPE); TriangleVertexArray::IndexDataType::INDEX_INTEGER_TYPE);
@ -151,14 +151,14 @@ class TestTriangleVertexArray : public Test {
// Get triangle indices // Get triangle indices
uint triangle0Indices[3]; uint32 triangle0Indices[3];
mTriangleVertexArray1->getTriangleVerticesIndices(0, triangle0Indices); mTriangleVertexArray1->getTriangleVerticesIndices(0, triangle0Indices);
rp3d_test(triangle0Indices[0] == mIndices1[0]); rp3d_test(triangle0Indices[0] == mIndices1[0]);
rp3d_test(triangle0Indices[1] == mIndices1[1]); rp3d_test(triangle0Indices[1] == mIndices1[1]);
rp3d_test(triangle0Indices[2] == mIndices1[2]); rp3d_test(triangle0Indices[2] == mIndices1[2]);
uint triangle1Indices[3]; uint32 triangle1Indices[3];
mTriangleVertexArray1->getTriangleVerticesIndices(1, triangle1Indices); mTriangleVertexArray1->getTriangleVerticesIndices(1, triangle1Indices);
rp3d_test(triangle1Indices[0] == mIndices1[3]); rp3d_test(triangle1Indices[0] == mIndices1[3]);