mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-21 06:32:33 -04:00
Merge branch 'release/1.9.x'
Conflicts: panda/src/glstuff/glShaderContext_src.cxx
This commit is contained in:
commit
5d7bc2c05e
@ -179,9 +179,9 @@ class GravityWalker(DirectObject.DirectObject):
|
|||||||
# a higher or lower value depending on whether you want an avatar
|
# a higher or lower value depending on whether you want an avatar
|
||||||
# that is outside of the world to step up to the floor when they
|
# that is outside of the world to step up to the floor when they
|
||||||
# get under valid floor:
|
# get under valid floor:
|
||||||
cRay = CollisionRay(0.0, 0.0, CollisionHandlerRayStart, 0.0, 0.0, -1.0)
|
self.cRay = CollisionRay(0.0, 0.0, CollisionHandlerRayStart, 0.0, 0.0, -1.0)
|
||||||
cRayNode = CollisionNode('GW.cRayNode')
|
cRayNode = CollisionNode('GW.cRayNode')
|
||||||
cRayNode.addSolid(cRay)
|
cRayNode.addSolid(self.cRay)
|
||||||
self.cRayNodePath = self.avatarNodePath.attachNewNode(cRayNode)
|
self.cRayNodePath = self.avatarNodePath.attachNewNode(cRayNode)
|
||||||
cRayNode.setFromCollideMask(bitmask)
|
cRayNode.setFromCollideMask(bitmask)
|
||||||
cRayNode.setIntoCollideMask(BitMask32.allOff())
|
cRayNode.setIntoCollideMask(BitMask32.allOff())
|
||||||
@ -697,8 +697,4 @@ class GravityWalker(DirectObject.DirectObject):
|
|||||||
# There are sometimes issues if the collision ray height is
|
# There are sometimes issues if the collision ray height is
|
||||||
# so tall that it collides with multiple levels of floors.
|
# so tall that it collides with multiple levels of floors.
|
||||||
def setCollisionRayHeight(self, height):
|
def setCollisionRayHeight(self, height):
|
||||||
oldNode = self.avatarNodePath.getNode(0)
|
self.cRay.setOrigin(0.0, 0.0, height)
|
||||||
cRayNode = oldNode.getChild(2)
|
|
||||||
cRayNode.removeSolid(0)
|
|
||||||
cRay = CollisionRay(0.0, 0.0, height, 0.0, 0.0, -1.0)
|
|
||||||
cRayNode.addSolid(cRay)
|
|
||||||
|
@ -1526,6 +1526,7 @@ issue_parameters(int altered) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GLint p = spec._id._seqno;
|
GLint p = spec._id._seqno;
|
||||||
|
int array_size = min(spec._dim[0], ptr_data->_size / spec._dim[1]);
|
||||||
switch (spec._type) {
|
switch (spec._type) {
|
||||||
case Shader::SPT_float:
|
case Shader::SPT_float:
|
||||||
{
|
{
|
||||||
@ -1534,16 +1535,16 @@ issue_parameters(int altered) {
|
|||||||
switch (ptr_data->_type) {
|
switch (ptr_data->_type) {
|
||||||
case Shader::SPT_int:
|
case Shader::SPT_int:
|
||||||
// Convert int data to float data.
|
// Convert int data to float data.
|
||||||
data = (float*) alloca(sizeof(float) * spec._dim[0] * spec._dim[1]);
|
data = (float*) alloca(sizeof(float) * array_size * spec._dim[1]);
|
||||||
for (int i = 0; i < (spec._dim[0] * spec._dim[1]); ++i) {
|
for (int i = 0; i < (array_size * spec._dim[1]); ++i) {
|
||||||
data[i] = (float)(((int*)ptr_data->_ptr)[i]);
|
data[i] = (float)(((int*)ptr_data->_ptr)[i]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Shader::SPT_double:
|
case Shader::SPT_double:
|
||||||
// Downgrade double data to float data.
|
// Downgrade double data to float data.
|
||||||
data = (float*) alloca(sizeof(float) * spec._dim[0] * spec._dim[1]);
|
data = (float*) alloca(sizeof(float) * array_size * spec._dim[1]);
|
||||||
for (int i = 0; i < (spec._dim[0] * spec._dim[1]); ++i) {
|
for (int i = 0; i < (array_size * spec._dim[1]); ++i) {
|
||||||
data[i] = (float)(((double*)ptr_data->_ptr)[i]);
|
data[i] = (float)(((double*)ptr_data->_ptr)[i]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1557,12 +1558,12 @@ issue_parameters(int altered) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (spec._dim[1]) {
|
switch (spec._dim[1]) {
|
||||||
case 1: _glgsg->_glUniform1fv(p, spec._dim[0], (float*)data); continue;
|
case 1: _glgsg->_glUniform1fv(p, array_size, (float*)data); continue;
|
||||||
case 2: _glgsg->_glUniform2fv(p, spec._dim[0], (float*)data); continue;
|
case 2: _glgsg->_glUniform2fv(p, array_size, (float*)data); continue;
|
||||||
case 3: _glgsg->_glUniform3fv(p, spec._dim[0], (float*)data); continue;
|
case 3: _glgsg->_glUniform3fv(p, array_size, (float*)data); continue;
|
||||||
case 4: _glgsg->_glUniform4fv(p, spec._dim[0], (float*)data); continue;
|
case 4: _glgsg->_glUniform4fv(p, array_size, (float*)data); continue;
|
||||||
case 9: _glgsg->_glUniformMatrix3fv(p, spec._dim[0], GL_FALSE, (float*)data); continue;
|
case 9: _glgsg->_glUniformMatrix3fv(p, array_size, GL_FALSE, (float*)data); continue;
|
||||||
case 16: _glgsg->_glUniformMatrix4fv(p, spec._dim[0], GL_FALSE, (float*)data); continue;
|
case 16: _glgsg->_glUniformMatrix4fv(p, array_size, GL_FALSE, (float*)data); continue;
|
||||||
}
|
}
|
||||||
nassertd(false) continue;
|
nassertd(false) continue;
|
||||||
}
|
}
|
||||||
@ -1579,10 +1580,10 @@ issue_parameters(int altered) {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
switch (spec._dim[1]) {
|
switch (spec._dim[1]) {
|
||||||
case 1: _glgsg->_glUniform1iv(p, spec._dim[0], (int*)ptr_data->_ptr); continue;
|
case 1: _glgsg->_glUniform1iv(p, array_size, (int*)ptr_data->_ptr); continue;
|
||||||
case 2: _glgsg->_glUniform2iv(p, spec._dim[0], (int*)ptr_data->_ptr); continue;
|
case 2: _glgsg->_glUniform2iv(p, array_size, (int*)ptr_data->_ptr); continue;
|
||||||
case 3: _glgsg->_glUniform3iv(p, spec._dim[0], (int*)ptr_data->_ptr); continue;
|
case 3: _glgsg->_glUniform3iv(p, array_size, (int*)ptr_data->_ptr); continue;
|
||||||
case 4: _glgsg->_glUniform4iv(p, spec._dim[0], (int*)ptr_data->_ptr); continue;
|
case 4: _glgsg->_glUniform4iv(p, array_size, (int*)ptr_data->_ptr); continue;
|
||||||
}
|
}
|
||||||
nassertd(false) continue;
|
nassertd(false) continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user