mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 16:36:54 +02:00
clarify how the size of the cube is computed
This commit is contained in:
parent
7cde6811ca
commit
27621b316d
1 changed files with 4 additions and 4 deletions
|
@ -1488,10 +1488,10 @@ static CollisionList myCollisions(64);
|
||||||
|
|
||||||
void MyAvatar::updateCollisionWithVoxels(float deltaTime, float radius) {
|
void MyAvatar::updateCollisionWithVoxels(float deltaTime, float radius) {
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::CollideAsRagdoll)) {
|
if (Menu::getInstance()->isOptionChecked(MenuOption::CollideAsRagdoll)) {
|
||||||
// compute the bounding cube around avatar
|
// We use a multiple of the avatar's boundingRadius as the size of the cube of interest.
|
||||||
float radius = 2.0f * getBoundingRadius();
|
float cubeScale = 4.0f * getBoundingRadius();
|
||||||
glm::vec3 corner = getPosition() - glm::vec3(radius);
|
glm::vec3 corner = getPosition() - glm::vec3(0.5f * cubeScale);
|
||||||
AACube boundingCube(corner, 2.0f * radius);
|
AACube boundingCube(corner, cubeScale);
|
||||||
|
|
||||||
// query the VoxelTree for cubes that touch avatar's boundingCube
|
// query the VoxelTree for cubes that touch avatar's boundingCube
|
||||||
CubeList cubes;
|
CubeList cubes;
|
||||||
|
|
Loading…
Reference in a new issue