mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 11:53:28 +02:00
add bots able to see voxels
This commit is contained in:
parent
c26ed77931
commit
69a83ee94d
1 changed files with 14 additions and 1 deletions
|
@ -28,7 +28,9 @@ var CHANCE_OF_HEAD_TURNING = 0.05;
|
|||
var CHANCE_OF_BIG_MOVE = 0.1;
|
||||
var CHANCE_OF_WAVING = 0.000; // Currently this isn't working
|
||||
|
||||
var shouldReceiveVoxels = false;
|
||||
var shouldReceiveVoxels = true;
|
||||
var VOXEL_FPS = 60.0;
|
||||
var lastVoxelQueryTime = 0.0;
|
||||
|
||||
var isMoving = false;
|
||||
var isTurningHead = false;
|
||||
|
@ -130,6 +132,17 @@ function updateBehavior(deltaTime) {
|
|||
|
||||
cumulativeTime += deltaTime;
|
||||
|
||||
if (shouldReceiveVoxels && ((cumulativeTime - lastVoxelQueryTime) > (1.0 / VOXEL_FPS))) {
|
||||
VoxelViewer.setPosition(Avatar.position);
|
||||
VoxelViewer.setOrientation(Avatar.orientation);
|
||||
VoxelViewer.queryOctree();
|
||||
lastVoxelQueryTime = cumulativeTime;
|
||||
/*
|
||||
if (Math.random() < (1.0 / VOXEL_FPS)) {
|
||||
print("Voxels in view = " + VoxelViewer.getOctreeElementsCount());
|
||||
}*/
|
||||
}
|
||||
|
||||
if (!isWaving && (Math.random() < CHANCE_OF_WAVING)) {
|
||||
isWaving = true;
|
||||
waveFrequency = 1.0 + Math.random() * 5.0;
|
||||
|
|
Loading…
Reference in a new issue