You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Float literals - fix math classes to allow 32 bit calculations
Converts float literals from double format (e.g. 0.0) to float format (e.g. 0.0f) where appropriate for 32 bit calculations, and cast to (real_t) or (float) as appropriate. This ensures that appropriate calculations will be done at 32 bits when real_t is compiled as float, rather than promoted to 64 bits.
This commit is contained in:
@@ -76,7 +76,7 @@ int TriangleMesh::_create_bvh(BVH *p_bvh, BVH **p_bb, int p_from, int p_size, in
|
||||
int index = max_alloc++;
|
||||
BVH *_new = &p_bvh[index];
|
||||
_new->aabb = aabb;
|
||||
_new->center = aabb.position + aabb.size * 0.5;
|
||||
_new->center = aabb.position + aabb.size * 0.5f;
|
||||
_new->face_index = -1;
|
||||
_new->left = left;
|
||||
_new->right = right;
|
||||
@@ -152,7 +152,7 @@ void TriangleMesh::create(const PoolVector<Vector3> &p_faces) {
|
||||
bw[i].left = -1;
|
||||
bw[i].right = -1;
|
||||
bw[i].face_index = i;
|
||||
bw[i].center = bw[i].aabb.position + bw[i].aabb.size * 0.5;
|
||||
bw[i].center = bw[i].aabb.position + bw[i].aabb.size * 0.5f;
|
||||
}
|
||||
|
||||
vertices.resize(db.size());
|
||||
|
||||
Reference in New Issue
Block a user