浏览代码

WARNING: RENAMED: MeshBoundingBox() -> GetMeshBoundingBox()

Renamed for consistency with other function in raylib.
pull/1780/head
Ray 3 年前
父节点
当前提交
e401d5c48e
共有 4 个文件被更改,包括 5 次插入5 次删除
  1. +2
    -2
      examples/models/models_loading.c
  2. +1
    -1
      examples/models/models_mesh_picking.c
  3. +1
    -1
      src/models.c
  4. +1
    -1
      src/raylib.h

+ 2
- 2
examples/models/models_loading.c 查看文件

@ -43,7 +43,7 @@ int main(void)
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
BoundingBox bounds = MeshBoundingBox(model.meshes[0]); // Set model bounds
BoundingBox bounds = GetMeshBoundingBox(model.meshes[0]); // Set model bounds
// NOTE: bounds are calculated from the original size of the model, // NOTE: bounds are calculated from the original size of the model,
// if model is scaled on drawing, bounds must be also scaled // if model is scaled on drawing, bounds must be also scaled
@ -78,7 +78,7 @@ int main(void)
model = LoadModel(droppedFiles[0]); // Load new model model = LoadModel(droppedFiles[0]); // Load new model
model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Set current map diffuse texture model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Set current map diffuse texture
bounds = MeshBoundingBox(model.meshes[0]);
bounds = GetMeshBoundingBox(model.meshes[0]);
// TODO: Move camera position from target enough distance to visualize model properly // TODO: Move camera position from target enough distance to visualize model properly
} }

+ 1
- 1
examples/models/models_mesh_picking.c 查看文件

@ -40,7 +40,7 @@ int main(void)
tower.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Set model diffuse texture tower.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture; // Set model diffuse texture
Vector3 towerPos = { 0.0f, 0.0f, 0.0f }; // Set model position Vector3 towerPos = { 0.0f, 0.0f, 0.0f }; // Set model position
BoundingBox towerBBox = MeshBoundingBox(tower.meshes[0]); // Get mesh bounding box
BoundingBox towerBBox = GetMeshBoundingBox(tower.meshes[0]); // Get mesh bounding box
bool hitMeshBBox = false; bool hitMeshBBox = false;
bool hitTriangle = false; bool hitTriangle = false;

+ 1
- 1
src/models.c 查看文件

@ -2617,7 +2617,7 @@ Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize)
// Compute mesh bounding box limits // Compute mesh bounding box limits
// NOTE: minVertex and maxVertex should be transformed by model transform matrix // NOTE: minVertex and maxVertex should be transformed by model transform matrix
BoundingBox MeshBoundingBox(Mesh mesh)
BoundingBox GetMeshBoundingBox(Mesh mesh)
{ {
// Get min and max vertex to construct bounds (AABB) // Get min and max vertex to construct bounds (AABB)
Vector3 minVertex = { 0 }; Vector3 minVertex = { 0 };

+ 1
- 1
src/raylib.h 查看文件

@ -1433,7 +1433,7 @@ RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size);
RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data
// Mesh manipulation functions // Mesh manipulation functions
RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits
RLAPI BoundingBox GetMeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits
RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents
RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals

正在加载...
取消
保存