mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 06:37:27 +02:00
Merge pull request #486 from ey6es/voxeltars
Fix for glGenBuffers issue.
This commit is contained in:
commit
f403fc33f7
3 changed files with 11 additions and 3 deletions
|
@ -1083,6 +1083,9 @@ void Application::idle() {
|
||||||
for(AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) {
|
for(AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) {
|
||||||
if (agent->getLinkedData() != NULL) {
|
if (agent->getLinkedData() != NULL) {
|
||||||
Avatar *avatar = (Avatar *)agent->getLinkedData();
|
Avatar *avatar = (Avatar *)agent->getLinkedData();
|
||||||
|
if (!avatar->isInitialized()) {
|
||||||
|
avatar->init();
|
||||||
|
}
|
||||||
avatar->simulate(deltaTime, NULL);
|
avatar->simulate(deltaTime, NULL);
|
||||||
avatar->setMouseRay(mouseRayOrigin, mouseRayDirection);
|
avatar->setMouseRay(mouseRayOrigin, mouseRayDirection);
|
||||||
}
|
}
|
||||||
|
@ -2061,6 +2064,9 @@ void Application::displaySide(Camera& whichCamera) {
|
||||||
for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) {
|
for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) {
|
||||||
if (agent->getLinkedData() != NULL && agent->getType() == AGENT_TYPE_AVATAR) {
|
if (agent->getLinkedData() != NULL && agent->getType() == AGENT_TYPE_AVATAR) {
|
||||||
Avatar *avatar = (Avatar *)agent->getLinkedData();
|
Avatar *avatar = (Avatar *)agent->getLinkedData();
|
||||||
|
if (!avatar->isInitialized()) {
|
||||||
|
avatar->init();
|
||||||
|
}
|
||||||
avatar->render(false);
|
avatar->render(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2534,9 +2540,7 @@ QAction* Application::checkedVoxelModeAction() const {
|
||||||
|
|
||||||
void Application::attachNewHeadToAgent(Agent* newAgent) {
|
void Application::attachNewHeadToAgent(Agent* newAgent) {
|
||||||
if (newAgent->getLinkedData() == NULL) {
|
if (newAgent->getLinkedData() == NULL) {
|
||||||
Avatar* newAvatar = new Avatar(newAgent);
|
newAgent->setLinkedData(new Avatar(newAgent));
|
||||||
newAvatar->init();
|
|
||||||
newAgent->setLinkedData(newAvatar);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@ float chatMessageHeight = 0.20;
|
||||||
|
|
||||||
Avatar::Avatar(Agent* owningAgent) :
|
Avatar::Avatar(Agent* owningAgent) :
|
||||||
AvatarData(owningAgent),
|
AvatarData(owningAgent),
|
||||||
|
_initialized(false),
|
||||||
_head(this),
|
_head(this),
|
||||||
_ballSpringsInitialized(false),
|
_ballSpringsInitialized(false),
|
||||||
_TEST_bigSphereRadius(0.5f),
|
_TEST_bigSphereRadius(0.5f),
|
||||||
|
@ -266,6 +267,7 @@ Avatar::~Avatar() {
|
||||||
|
|
||||||
void Avatar::init() {
|
void Avatar::init() {
|
||||||
_voxels.init();
|
_voxels.init();
|
||||||
|
_initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Avatar::reset() {
|
void Avatar::reset() {
|
||||||
|
|
|
@ -100,6 +100,7 @@ public:
|
||||||
void setOrientation (const glm::quat& orientation);
|
void setOrientation (const glm::quat& orientation);
|
||||||
|
|
||||||
//getters
|
//getters
|
||||||
|
bool isInitialized () const { return _initialized;}
|
||||||
const Skeleton& getSkeleton () const { return _skeleton;}
|
const Skeleton& getSkeleton () const { return _skeleton;}
|
||||||
float getHeadYawRate () const { return _head.yawRate;}
|
float getHeadYawRate () const { return _head.yawRate;}
|
||||||
float getBodyYaw () const { return _bodyYaw;}
|
float getBodyYaw () const { return _bodyYaw;}
|
||||||
|
@ -156,6 +157,7 @@ private:
|
||||||
float touchForce; // a scalar determining the amount that the cursor (or hand) is penetrating the ball
|
float touchForce; // a scalar determining the amount that the cursor (or hand) is penetrating the ball
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool _initialized;
|
||||||
Head _head;
|
Head _head;
|
||||||
Skeleton _skeleton;
|
Skeleton _skeleton;
|
||||||
bool _ballSpringsInitialized;
|
bool _ballSpringsInitialized;
|
||||||
|
|
Loading…
Reference in a new issue