root / PyOpenGL-Demo / broken / NeHe / lesson44 / glCamera.py
Historique | Voir | Annoter | Télécharger (32,03 ko)
| 1 |
# // Code writen by: Vic Hollis 09/07/2003
|
|---|---|
| 2 |
# // I don't mind if you use this class in your own code. All I ask is
|
| 3 |
# // that you give me credit for it if you do. And plug NeHe while your
|
| 4 |
# // at it! :P Thanks go to David Steere, Cameron Tidwell, Bert Sammons,
|
| 5 |
# // and Brannon Martindale for helping me test all the code! Enjoy.
|
| 6 |
# //////////////////////////////////////////////////////////////////////
|
| 7 |
# // glCamera.h: interface for the glCamera class.
|
| 8 |
# //////////////////////////////////////////////////////////////////////
|
| 9 |
#
|
| 10 |
# //////////////////////////////////////////////////////////////////////
|
| 11 |
# // Some minimal additions by rIO.Spinning Kids
|
| 12 |
# // For testing flares against occluding objects.
|
| 13 |
# // Not using proprietary extensions, this is PURE OpenGL1.1
|
| 14 |
# //
|
| 15 |
# // Just call the IsOccluded function, passing it the glPoint to check
|
| 16 |
# //
|
| 17 |
# //////////////////////////////////////////////////////////////////////
|
| 18 |
#
|
| 19 |
# Ported to Python, PyOpenGL by Brian Leair 2004.
|
| 20 |
# The numarray python module can perform matrix math more effieciently
|
| 21 |
# than direct python code. However, for this tutorial the differnce
|
| 22 |
# in performance isn't huge and it makes for a better tutorial to see
|
| 23 |
# the math operations directly.
|
| 24 |
|
| 25 |
from OpenGL.GL import * |
| 26 |
from OpenGL.GLU import * |
| 27 |
from OpenGL.GLUT import * |
| 28 |
from glPoint import * |
| 29 |
from glVector import * |
| 30 |
from math import sqrt, fabs |
| 31 |
|
| 32 |
try:
|
| 33 |
import numpy as Numeric |
| 34 |
except ImportError: |
| 35 |
try:
|
| 36 |
import Numeric |
| 37 |
except ImportError: |
| 38 |
print("This demo requires the numpy or Numeric extension, sorry")
|
| 39 |
import sys |
| 40 |
sys.exit() |
| 41 |
import copy |
| 42 |
|
| 43 |
class glCamera: |
| 44 |
# //////////// CONSTRUCTORS /////////////////////////////////////////
|
| 45 |
def __init__ (self): |
| 46 |
# // Initalize all our member varibles.
|
| 47 |
self.m_MaxPitchRate = 0.0; |
| 48 |
self.m_MaxHeadingRate = 0.0; |
| 49 |
self.m_HeadingDegrees = 0.0; |
| 50 |
self.m_PitchDegrees = 0.0; |
| 51 |
self.m_MaxForwardVelocity = 0.0; |
| 52 |
self.m_ForwardVelocity = 0.0; |
| 53 |
self.m_GlowTexture = None; |
| 54 |
# bleair: NOTE that glCamera.cpp has a bug. m_BigGlowTexture isn't initialized.
|
| 55 |
# Very minor bug because only in the case where we fail to get an earlier
|
| 56 |
# texture will the class potentially read from the uninited memory. Most of
|
| 57 |
# the time the field is assigned to straight away in InitGL ().
|
| 58 |
self.m_BigGlowTexture = None; |
| 59 |
self.m_HaloTexture = None; |
| 60 |
self.m_StreakTexture = None; |
| 61 |
self.m_MaxPointSize = 0.0; |
| 62 |
self.m_Frustum = Numeric.zeros ( (6,4), 'f') |
| 63 |
|
| 64 |
self.m_LightSourcePos = glPoint ()
|
| 65 |
self.m_Position = glPoint ()
|
| 66 |
self.m_DirectionVector = glVector ()
|
| 67 |
self.m_ptIntersect = glPoint ()
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
def __del__ (self): |
| 73 |
self.release ()
|
| 74 |
return
|
| 75 |
|
| 76 |
def release (self): |
| 77 |
if (self.m_GlowTexture != None): |
| 78 |
glDeleteTextures (self.m_GlowTexture)
|
| 79 |
if (self.m_HaloTexture != None): |
| 80 |
glDeleteTextures (self.m_HaloTexture)
|
| 81 |
if (self.m_BigGlowTexture != None): |
| 82 |
glDeleteTextures (self.m_BigGlowTexture)
|
| 83 |
if (self.m_StreakTexture != None): |
| 84 |
glDeleteTextures (self.m_StreakTexture)
|
| 85 |
return
|
| 86 |
|
| 87 |
def ChangePitch (self, degrees): |
| 88 |
if (fabs (degrees) < fabs (self.m_MaxPitchRate)): |
| 89 |
# // Our pitch is less than the max pitch rate that we
|
| 90 |
# // defined so lets increment it.
|
| 91 |
self.m_PitchDegrees += degrees;
|
| 92 |
else:
|
| 93 |
# // Our pitch is greater than the max pitch rate that
|
| 94 |
# // we defined so we can only increment our pitch by the
|
| 95 |
# // maximum allowed value.
|
| 96 |
if(degrees < 0): |
| 97 |
# // We are pitching down so decrement
|
| 98 |
self.m_PitchDegrees -= self.m_MaxPitchRate; |
| 99 |
else:
|
| 100 |
# // We are pitching up so increment
|
| 101 |
self.m_PitchDegrees += self.m_MaxPitchRate; |
| 102 |
|
| 103 |
# // We don't want our pitch to run away from us. Although it
|
| 104 |
# // really doesn't matter I prefer to have my pitch degrees
|
| 105 |
# // within the range of -360.0f to 360.0f
|
| 106 |
if (self.m_PitchDegrees > 360.0): |
| 107 |
self.m_PitchDegrees -= 360.0; |
| 108 |
elif (self.m_PitchDegrees < -360.0): |
| 109 |
self.m_PitchDegrees += 360.0; |
| 110 |
|
| 111 |
return
|
| 112 |
|
| 113 |
def ChangeHeading (self, degrees): |
| 114 |
if(fabs(degrees) < fabs(self.m_MaxHeadingRate)): |
| 115 |
# // Our Heading is less than the max heading rate that we
|
| 116 |
# // defined so lets increment it but first we must check
|
| 117 |
# // to see if we are inverted so that our heading will not
|
| 118 |
# // become inverted.
|
| 119 |
if (self.m_PitchDegrees > 90 and self.m_PitchDegrees < 270 or |
| 120 |
(self.m_PitchDegrees < -90 and self.m_PitchDegrees > -270)): |
| 121 |
self.m_HeadingDegrees -= degrees;
|
| 122 |
else:
|
| 123 |
self.m_HeadingDegrees += degrees;
|
| 124 |
else:
|
| 125 |
# // Our heading is greater than the max heading rate that
|
| 126 |
# // we defined so we can only increment our heading by the
|
| 127 |
# // maximum allowed value.
|
| 128 |
if(degrees < 0): |
| 129 |
# // Check to see if we are upside down.
|
| 130 |
if ((self.m_PitchDegrees > 90 and self.m_PitchDegrees < 270) or |
| 131 |
(self.m_PitchDegrees < -90 and self.m_PitchDegrees > -270)): |
| 132 |
# // Ok we would normally decrement here but since we are upside
|
| 133 |
# // down then we need to increment our heading
|
| 134 |
self.m_HeadingDegrees += self.m_MaxHeadingRate; |
| 135 |
else:
|
| 136 |
# // We are not upside down so decrement as usual
|
| 137 |
self.m_HeadingDegrees -= self.m_MaxHeadingRate; |
| 138 |
else:
|
| 139 |
# // Check to see if we are upside down.
|
| 140 |
if (self.m_PitchDegrees > 90 and self.m_PitchDegrees < 270 or |
| 141 |
(self.m_PitchDegrees < -90 and self.m_PitchDegrees > -270)): |
| 142 |
# // Ok we would normally increment here but since we are upside
|
| 143 |
# // down then we need to decrement our heading.
|
| 144 |
self.m_HeadingDegrees -= self.m_MaxHeadingRate; |
| 145 |
else:
|
| 146 |
# // We are not upside down so increment as usual.
|
| 147 |
self.m_HeadingDegrees += self.m_MaxHeadingRate; |
| 148 |
|
| 149 |
# // We don't want our heading to run away from us either. Although it
|
| 150 |
# // really doesn't matter I prefer to have my heading degrees
|
| 151 |
# // within the range of -360.0f to 360.0f
|
| 152 |
if(self.m_HeadingDegrees > 360.0): |
| 153 |
self.m_HeadingDegrees -= 360.0; |
| 154 |
elif(self.m_HeadingDegrees < -360.0): |
| 155 |
self.m_HeadingDegrees += 360.0; |
| 156 |
|
| 157 |
return
|
| 158 |
|
| 159 |
# //////////// FUNCTIONS TO CHANGE CAMERA ORIENTATION AND SPEED /////
|
| 160 |
def ChangeVelocity(self, vel): |
| 161 |
if(fabs(vel) < fabs(self.m_MaxForwardVelocity)): |
| 162 |
# // Our velocity is less than the max velocity increment that we
|
| 163 |
# // defined so lets increment it.
|
| 164 |
self.m_ForwardVelocity += vel;
|
| 165 |
else:
|
| 166 |
# // Our velocity is greater than the max velocity increment that
|
| 167 |
# // we defined so we can only increment our velocity by the
|
| 168 |
# // maximum allowed value.
|
| 169 |
if(vel < 0): |
| 170 |
# // We are slowing down so decrement
|
| 171 |
self.m_ForwardVelocity -= -self.m_MaxForwardVelocity; |
| 172 |
else:
|
| 173 |
# // We are speeding up so increment
|
| 174 |
self.m_ForwardVelocity += self.m_MaxForwardVelocity; |
| 175 |
|
| 176 |
return
|
| 177 |
|
| 178 |
def UpdateFrustum(self): |
| 179 |
""" // I found this code here: http://www.markmorley.com/opengl/frustumculling.html
|
| 180 |
// and decided to make it part of
|
| 181 |
// the camera class just in case I might want to rotate
|
| 182 |
// and translate the projection matrix. This code will
|
| 183 |
// make sure that the Frustum is updated correctly but
|
| 184 |
// this member is computational expensive with:
|
| 185 |
// 82 muliplications, 72 additions, 24 divisions, and
|
| 186 |
// 12 subtractions for a total of 190 operations. Ouch! """
|
| 187 |
|
| 188 |
# /* Get the current PROJECTION matrix from OpenGL */
|
| 189 |
proj = glGetFloatv( GL_PROJECTION_MATRIX); |
| 190 |
|
| 191 |
# /* Get the current MODELVIEW matrix from OpenGL */
|
| 192 |
modl = glGetFloatv( GL_MODELVIEW_MATRIX); |
| 193 |
|
| 194 |
# /* Combine the two matrices (multiply projection by modelview) */
|
| 195 |
# Careful, Note, that replication is simple scalars is OK, but replicate of objects
|
| 196 |
# and lists is very bad.
|
| 197 |
clip = [None,] * 16 |
| 198 |
# clip = Numeric.zeros ( (16), 'f')
|
| 199 |
clip[ 0] = modl[ 0] * proj[ 0] + modl[ 1] * proj[ 4] + modl[ 2] * proj[ 8] + modl[ 3] * proj[12]; |
| 200 |
clip[ 1] = modl[ 0] * proj[ 1] + modl[ 1] * proj[ 5] + modl[ 2] * proj[ 9] + modl[ 3] * proj[13]; |
| 201 |
clip[ 2] = modl[ 0] * proj[ 2] + modl[ 1] * proj[ 6] + modl[ 2] * proj[10] + modl[ 3] * proj[14]; |
| 202 |
clip[ 3] = modl[ 0] * proj[ 3] + modl[ 1] * proj[ 7] + modl[ 2] * proj[11] + modl[ 3] * proj[15]; |
| 203 |
|
| 204 |
clip[ 4] = modl[ 4] * proj[ 0] + modl[ 5] * proj[ 4] + modl[ 6] * proj[ 8] + modl[ 7] * proj[12]; |
| 205 |
clip[ 5] = modl[ 4] * proj[ 1] + modl[ 5] * proj[ 5] + modl[ 6] * proj[ 9] + modl[ 7] * proj[13]; |
| 206 |
clip[ 6] = modl[ 4] * proj[ 2] + modl[ 5] * proj[ 6] + modl[ 6] * proj[10] + modl[ 7] * proj[14]; |
| 207 |
clip[ 7] = modl[ 4] * proj[ 3] + modl[ 5] * proj[ 7] + modl[ 6] * proj[11] + modl[ 7] * proj[15]; |
| 208 |
|
| 209 |
clip[ 8] = modl[ 8] * proj[ 0] + modl[ 9] * proj[ 4] + modl[10] * proj[ 8] + modl[11] * proj[12]; |
| 210 |
clip[ 9] = modl[ 8] * proj[ 1] + modl[ 9] * proj[ 5] + modl[10] * proj[ 9] + modl[11] * proj[13]; |
| 211 |
clip[10] = modl[ 8] * proj[ 2] + modl[ 9] * proj[ 6] + modl[10] * proj[10] + modl[11] * proj[14]; |
| 212 |
clip[11] = modl[ 8] * proj[ 3] + modl[ 9] * proj[ 7] + modl[10] * proj[11] + modl[11] * proj[15]; |
| 213 |
|
| 214 |
clip[12] = modl[12] * proj[ 0] + modl[13] * proj[ 4] + modl[14] * proj[ 8] + modl[15] * proj[12]; |
| 215 |
clip[13] = modl[12] * proj[ 1] + modl[13] * proj[ 5] + modl[14] * proj[ 9] + modl[15] * proj[13]; |
| 216 |
clip[14] = modl[12] * proj[ 2] + modl[13] * proj[ 6] + modl[14] * proj[10] + modl[15] * proj[14]; |
| 217 |
clip[15] = modl[12] * proj[ 3] + modl[13] * proj[ 7] + modl[14] * proj[11] + modl[15] * proj[15]; |
| 218 |
|
| 219 |
# ### Use a shortened name to reference to our camera's Frustum (does
|
| 220 |
# ### not copy anything, just a ref to make code less wordy
|
| 221 |
Frustum = self.m_Frustum
|
| 222 |
|
| 223 |
# /* Extract the numbers for the RIGHT plane */
|
| 224 |
Frustum[0][0] = clip[ 3] - clip[ 0]; |
| 225 |
Frustum[0][1] = clip[ 7] - clip[ 4]; |
| 226 |
Frustum[0][2] = clip[11] - clip[ 8]; |
| 227 |
Frustum[0][3] = clip[15] - clip[12]; |
| 228 |
|
| 229 |
# /* Normalize the result */
|
| 230 |
t = (sqrt( Frustum[0][0] * Frustum[0][0] + \ |
| 231 |
Frustum[0][1] * Frustum[0][1] + Frustum[0][2] * Frustum[0][2] )); |
| 232 |
Frustum[0][0] /= t; |
| 233 |
Frustum[0][1] /= t; |
| 234 |
Frustum[0][2] /= t; |
| 235 |
Frustum[0][3] /= t; |
| 236 |
|
| 237 |
# /* Extract the numbers for the LEFT plane */
|
| 238 |
Frustum[1][0] = clip[ 3] + clip[ 0]; |
| 239 |
Frustum[1][1] = clip[ 7] + clip[ 4]; |
| 240 |
Frustum[1][2] = clip[11] + clip[ 8]; |
| 241 |
Frustum[1][3] = clip[15] + clip[12]; |
| 242 |
|
| 243 |
# /* Normalize the result */
|
| 244 |
t = sqrt( Frustum[1][0] * Frustum[1][0] + Frustum[1][1] * Frustum[1][1] + Frustum[1][2] * Frustum[1][2] ); |
| 245 |
Frustum[1][0] /= t; |
| 246 |
Frustum[1][1] /= t; |
| 247 |
Frustum[1][2] /= t; |
| 248 |
Frustum[1][3] /= t; |
| 249 |
|
| 250 |
# /* Extract the BOTTOM plane */
|
| 251 |
Frustum[2][0] = clip[ 3] + clip[ 1]; |
| 252 |
Frustum[2][1] = clip[ 7] + clip[ 5]; |
| 253 |
Frustum[2][2] = clip[11] + clip[ 9]; |
| 254 |
Frustum[2][3] = clip[15] + clip[13]; |
| 255 |
|
| 256 |
# /* Normalize the result */
|
| 257 |
t = sqrt( Frustum[2][0] * Frustum[2][0] + Frustum[2][1] * Frustum[2][1] + Frustum[2][2] * Frustum[2][2] ); |
| 258 |
Frustum[2][0] /= t; |
| 259 |
Frustum[2][1] /= t; |
| 260 |
Frustum[2][2] /= t; |
| 261 |
Frustum[2][3] /= t; |
| 262 |
|
| 263 |
# /* Extract the TOP plane */
|
| 264 |
Frustum[3][0] = clip[ 3] - clip[ 1]; |
| 265 |
Frustum[3][1] = clip[ 7] - clip[ 5]; |
| 266 |
Frustum[3][2] = clip[11] - clip[ 9]; |
| 267 |
Frustum[3][3] = clip[15] - clip[13]; |
| 268 |
|
| 269 |
# /* Normalize the result */
|
| 270 |
t = sqrt( Frustum[3][0] * Frustum[3][0] + Frustum[3][1] * Frustum[3][1] + Frustum[3][2] * Frustum[3][2] ) |
| 271 |
Frustum[3][0] /= t; |
| 272 |
Frustum[3][1] /= t; |
| 273 |
Frustum[3][2] /= t; |
| 274 |
Frustum[3][3] /= t; |
| 275 |
|
| 276 |
# /* Extract the FAR plane */
|
| 277 |
|
| 278 |
Frustum[4][0] = clip[ 3] - clip[ 2]; |
| 279 |
Frustum[4][1] = clip[ 7] - clip[ 6]; |
| 280 |
Frustum[4][2] = clip[11] - clip[10]; |
| 281 |
Frustum[4][3] = clip[15] - clip[14]; |
| 282 |
|
| 283 |
# /* Normalize the result */
|
| 284 |
t = sqrt( Frustum[4][0] * Frustum[4][0] + Frustum[4][1] * Frustum[4][1] + Frustum[4][2] * Frustum[4][2] ) |
| 285 |
Frustum[4][0] /= t; |
| 286 |
Frustum[4][1] /= t; |
| 287 |
Frustum[4][2] /= t; |
| 288 |
Frustum[4][3] /= t; |
| 289 |
|
| 290 |
# /* Extract the NEAR plane */
|
| 291 |
Frustum[5][0] = clip[ 3] + clip[ 2]; |
| 292 |
Frustum[5][1] = clip[ 7] + clip[ 6]; |
| 293 |
Frustum[5][2] = clip[11] + clip[10]; |
| 294 |
Frustum[5][3] = clip[15] + clip[14]; |
| 295 |
|
| 296 |
# /* Normalize the result */
|
| 297 |
t = sqrt( Frustum[5][0] * Frustum[5][0] + Frustum[5][1] * Frustum[5][1] + Frustum[5][2] * Frustum[5][2] ); |
| 298 |
Frustum[5][0] /= t; |
| 299 |
Frustum[5][1] /= t; |
| 300 |
Frustum[5][2] /= t; |
| 301 |
Frustum[5][3] /= t; |
| 302 |
|
| 303 |
return
|
| 304 |
|
| 305 |
# //////////// FUNCTIONS TO UPDATE THE FRUSTUM //////////////////////
|
| 306 |
def UpdateFrustumFaster (self): |
| 307 |
""" // This is the much faster version of the above member
|
| 308 |
// function, however the speed increase is not gained
|
| 309 |
// without a cost. If you rotate or translate the projection
|
| 310 |
// matrix then this member will not work correctly. That is acceptable
|
| 311 |
// in my book considering I very rarely do such a thing.
|
| 312 |
// This function has far fewer operations in it and I
|
| 313 |
// shaved off 2 square root functions by passing in the
|
| 314 |
// near and far values. This member has:
|
| 315 |
// 38 muliplications, 28 additions, 24 divisions, and
|
| 316 |
// 12 subtractions for a total of 102 operations. Still hurts
|
| 317 |
// but at least it is decent now. In practice this will
|
| 318 |
// run about 2 times faster than the above function. """
|
| 319 |
|
| 320 |
# /* Get the current PROJECTION matrix from OpenGL */
|
| 321 |
proj = glGetFloatv( GL_PROJECTION_MATRIX); |
| 322 |
|
| 323 |
# /* Get the current MODELVIEW matrix from OpenGL */
|
| 324 |
modl = glGetFloatv( GL_MODELVIEW_MATRIX); |
| 325 |
|
| 326 |
# /* Combine the two matrices (multiply projection by modelview)
|
| 327 |
# but keep in mind this function will only work if you do NOT
|
| 328 |
# rotate or translate your projection matrix */
|
| 329 |
clip = [0,] * 16 |
| 330 |
modl_row1 = modl [0]
|
| 331 |
clip[ 0] = modl [0] [0] * proj[0][0]; |
| 332 |
clip[ 1] = modl [0][ 1] * proj[1][1]; |
| 333 |
clip[ 2] = modl [0][ 2] * proj[2][2] + modl_row1[ 3] * proj[3][2] |
| 334 |
clip[ 3] = modl [0][ 2] * proj[2][3] |
| 335 |
|
| 336 |
modl_row2 = modl [1]
|
| 337 |
clip[ 4] = modl_row2[ 0] * proj[0][0] |
| 338 |
clip[ 5] = modl_row2[ 1] * proj[1][1] |
| 339 |
clip[ 6] = modl_row2[ 2] * proj[2][2] + modl_row2[ 3] * proj[3][2] |
| 340 |
clip[ 7] = modl_row2[ 2] * proj[2][3] |
| 341 |
|
| 342 |
modl_row3 = modl [2]
|
| 343 |
clip[ 8] = modl_row3[ 0] * proj[0][0]; |
| 344 |
clip[ 9] = modl_row3[ 1] * proj[1][1] |
| 345 |
clip[10] = modl_row3[2] * proj[2][2] + modl_row3[3] * proj[3][2] |
| 346 |
clip[11] = modl_row3[2] * proj[2][3] |
| 347 |
|
| 348 |
modl_row4 = modl [3]
|
| 349 |
clip[12] = modl_row4[0] * proj[0][0] |
| 350 |
clip[13] = modl_row4[1] * proj[1][1] |
| 351 |
clip[14] = modl_row4[2] * proj[2][2] + modl_row4[3] * proj[3][2] |
| 352 |
clip[15] = modl_row4[2] * proj[2][3] |
| 353 |
|
| 354 |
# ### Use a shortened name to reference to our camera's Frustum (does
|
| 355 |
# ### not copy anything, just a ref to make code less wordy
|
| 356 |
Frustum = self.m_Frustum
|
| 357 |
|
| 358 |
# /* Extract the numbers for the RIGHT plane */
|
| 359 |
Frustum[0][0] = clip[ 3] - clip[ 0]; |
| 360 |
Frustum[0][1] = clip[ 7] - clip[ 4]; |
| 361 |
Frustum[0][2] = clip[11] - clip[ 8]; |
| 362 |
Frustum[0][3] = clip[15] - clip[12]; |
| 363 |
|
| 364 |
# /* Normalize the result */
|
| 365 |
t = sqrt( (Frustum[0][0] * Frustum[0][0]) + (Frustum[0][1] * Frustum[0][1]) + (Frustum[0][2] * Frustum[0][2]) ); |
| 366 |
Frustum[0][0] /= t; |
| 367 |
Frustum[0][1] /= t; |
| 368 |
Frustum[0][2] /= t; |
| 369 |
Frustum[0][3] /= t; |
| 370 |
|
| 371 |
# /* Extract the numbers for the LEFT plane */
|
| 372 |
Frustum[1][0] = clip[ 3] + clip[ 0]; |
| 373 |
Frustum[1][1] = clip[ 7] + clip[ 4]; |
| 374 |
Frustum[1][2] = clip[11] + clip[ 8]; |
| 375 |
Frustum[1][3] = clip[15] + clip[12]; |
| 376 |
|
| 377 |
# /* Normalize the result */
|
| 378 |
t = sqrt( Frustum[1][0] * Frustum[1][0] + Frustum[1][1] * Frustum[1][1] + Frustum[1][2] * Frustum[1][2] ); |
| 379 |
Frustum[1][0] /= t; |
| 380 |
Frustum[1][1] /= t; |
| 381 |
Frustum[1][2] /= t; |
| 382 |
Frustum[1][3] /= t; |
| 383 |
|
| 384 |
# /* Extract the BOTTOM plane */
|
| 385 |
Frustum[2][0] = clip[ 3] + clip[ 1]; |
| 386 |
Frustum[2][1] = clip[ 7] + clip[ 5]; |
| 387 |
Frustum[2][2] = clip[11] + clip[ 9]; |
| 388 |
Frustum[2][3] = clip[15] + clip[13]; |
| 389 |
|
| 390 |
# /* Normalize the result */
|
| 391 |
t = sqrt( Frustum[2][0] * Frustum[2][0] + Frustum[2][1] * Frustum[2][1] + Frustum[2][2] * Frustum[2][2] ); |
| 392 |
Frustum[2][0] /= t; |
| 393 |
Frustum[2][1] /= t; |
| 394 |
Frustum[2][2] /= t; |
| 395 |
Frustum[2][3] /= t; |
| 396 |
|
| 397 |
# /* Extract the TOP plane */
|
| 398 |
Frustum[3][0] = clip[ 3] - clip[ 1]; |
| 399 |
Frustum[3][1] = clip[ 7] - clip[ 5]; |
| 400 |
Frustum[3][2] = clip[11] - clip[ 9]; |
| 401 |
Frustum[3][3] = clip[15] - clip[13]; |
| 402 |
|
| 403 |
# /* Normalize the result */
|
| 404 |
t = sqrt( Frustum[3][0] * Frustum[3][0] + Frustum[3][1] * Frustum[3][1] + Frustum[3][2] * Frustum[3][2] ); |
| 405 |
Frustum[3][0] /= t; |
| 406 |
Frustum[3][1] /= t; |
| 407 |
Frustum[3][2] /= t; |
| 408 |
Frustum[3][3] /= t; |
| 409 |
|
| 410 |
# /* Extract the FAR plane */
|
| 411 |
Frustum[4][0] = clip[ 3] - clip[ 2]; |
| 412 |
Frustum[4][1] = clip[ 7] - clip[ 6]; |
| 413 |
Frustum[4][2] = clip[11] - clip[10]; |
| 414 |
Frustum[4][3] = clip[15] - clip[14]; |
| 415 |
|
| 416 |
# /* Normalize the result */
|
| 417 |
t = sqrt( (Frustum[4][0] * Frustum[4][0]) + (Frustum[4][1] * Frustum[4][1]) + (Frustum[4][2] * Frustum[4][2]) ); |
| 418 |
Frustum[4][0] /= t; |
| 419 |
Frustum[4][1] /= t; |
| 420 |
Frustum[4][2] /= t; |
| 421 |
Frustum[4][3] /= t; |
| 422 |
|
| 423 |
# /* Extract the NEAR plane */
|
| 424 |
Frustum[5][0] = clip[ 3] + clip[ 2]; |
| 425 |
Frustum[5][1] = clip[ 7] + clip[ 6]; |
| 426 |
Frustum[5][2] = clip[11] + clip[10]; |
| 427 |
Frustum[5][3] = clip[15] + clip[14]; |
| 428 |
|
| 429 |
# /* Normalize the result */
|
| 430 |
t = sqrt( Frustum[5][0] * Frustum[5][0] + Frustum[5][1] * Frustum[5][1] + Frustum[5][2] * Frustum[5][2] ); |
| 431 |
Frustum[5][0] /= t; |
| 432 |
Frustum[5][1] /= t; |
| 433 |
Frustum[5][2] /= t; |
| 434 |
Frustum[5][3] /= t; |
| 435 |
|
| 436 |
return
|
| 437 |
|
| 438 |
|
| 439 |
|
| 440 |
# //////////// FRUSTUM TESTING FUNCTIONS ////////////////////////////
|
| 441 |
def SphereInFrustum(self, p, Radius): |
| 442 |
""" // This member function checks to see if a sphere is in
|
| 443 |
// the viewing volume. """
|
| 444 |
|
| 445 |
Frustum = self.m_Frustum
|
| 446 |
# // The idea here is the same as the PointInFrustum function.
|
| 447 |
if (Radius != 0): |
| 448 |
for i in range(6): |
| 449 |
# // If the point is outside of the plane then its not in the viewing volume.
|
| 450 |
if(Frustum[i][0] * p.x + Frustum[i][1] * p.y + Frustum[i][2] * p.z + Frustum[i][3] <= -Radius): |
| 451 |
return(False); |
| 452 |
else:
|
| 453 |
# // The idea here is the same as the PointInFrustum function.
|
| 454 |
for i in range(6): |
| 455 |
# // If the point is outside of the plane then its not in the viewing volume.
|
| 456 |
if(Frustum[i][0] * p.x + Frustum[i][1] * p.y + Frustum[i][2] * p.z + Frustum[i][3] <= 0): |
| 457 |
return(False); |
| 458 |
|
| 459 |
return(True); |
| 460 |
|
| 461 |
def PointInFrustum(self, x,y,z): |
| 462 |
""" // This member fuction checks to see if a point is in
|
| 463 |
// the viewing volume. """
|
| 464 |
|
| 465 |
# // The idea behind this algorithum is that if the point
|
| 466 |
# // is inside all 6 clipping planes then it is inside our
|
| 467 |
# // viewing volume so we can return true.
|
| 468 |
|
| 469 |
Frustum = self.m_Frustum
|
| 470 |
# // Loop through all our clipping planes
|
| 471 |
for i in range(6): |
| 472 |
# // If the point is outside of the plane then its not in the viewing volume.
|
| 473 |
if(Frustum[i][0] * x + Frustum[i][1] * y + Frustum[i][2] * z + Frustum[i][3] <= 0): |
| 474 |
return(False); |
| 475 |
|
| 476 |
return(True); |
| 477 |
|
| 478 |
# /////////// OCCLUSION TESTING FUNCTIONS ///////////////////////////
|
| 479 |
def IsOccluded (self, p): |
| 480 |
# // Now we will ask OGL to project some geometry for us using the gluProject function.
|
| 481 |
# // Practically we ask OGL to guess where a point in space will be projected in our current viewport,
|
| 482 |
# // using arbitrary viewport and transform matrices we pass to the function.
|
| 483 |
# // If we pass to the function the current matrices (retrievede with the glGet funcs)
|
| 484 |
# // we will have the real position on screen where the dot will be drawn.
|
| 485 |
# // The interesting part is that we also get a Z value back, this means that
|
| 486 |
# // reading the REAL buffer for Z values we can discover if the flare is in front or
|
| 487 |
# // if it's occluded by some objects.
|
| 488 |
# ### This function should be a flat function, not a function of the camera as we
|
| 489 |
# ### use the immediate GL rendering state entirely.
|
| 490 |
|
| 491 |
|
| 492 |
# ### Viewport is the rectangle of window pixels that OpenGL is rasterizing into.
|
| 493 |
viewport = glGetIntegerv (GL_VIEWPORT); # //get actual viewport
|
| 494 |
mvmatrix = glGetDoublev (GL_MODELVIEW_MATRIX); # //get actual model view matrix
|
| 495 |
projmatrix = glGetDoublev (GL_PROJECTION_MATRIX); # //get actual projiection matrix
|
| 496 |
|
| 497 |
# // this asks OGL to guess the 2d position of a 3d point inside the viewport
|
| 498 |
winx, winy, winz = gluProject(p.x, p.y, p.z, mvmatrix, projmatrix, viewport) |
| 499 |
flareZ = winz; |
| 500 |
|
| 501 |
# // we read back one pixel from th depth buffer (exactly where our flare should be drawn)
|
| 502 |
glPixelStorei(GL_PACK_ALIGNMENT, 1)
|
| 503 |
|
| 504 |
# PyOpenGL 2.0.1.07 bug, Only the type clarified function works.
|
| 505 |
# bufferZ = glReadPixels(int(winx), int(winy),1,1,GL_DEPTH_COMPONENT, GL_FLOAT)
|
| 506 |
bufferZ = glReadPixelsf(int(winx), int(winy),1,1,GL_DEPTH_COMPONENT) |
| 507 |
|
| 508 |
# // if the buffer Z is lower than our flare guessed Z then don't draw
|
| 509 |
# // this means there is something in front of our flare
|
| 510 |
if (bufferZ [0] [0] < flareZ): |
| 511 |
return True; |
| 512 |
else:
|
| 513 |
return False; |
| 514 |
|
| 515 |
# //////////// FUNCTIONS TO RENDER LENS FLARES //////////////////////
|
| 516 |
def RenderLensFlare(self): |
| 517 |
# // Draw the flare only If the light source is in our line of sight (inside the Frustum)
|
| 518 |
if (self.SphereInFrustum(self.m_LightSourcePos, 1.0) == True): |
| 519 |
|
| 520 |
# Vector pointing from the light's position toward the camera's position (the camera might
|
| 521 |
# be pointing elsewhere, this vector is pointing from the light to the camera)
|
| 522 |
self.vLightSourceToCamera = self.m_Position - self.m_LightSourcePos; # // Lets compute the vector that points to the camera from |
| 523 |
# // the light source.
|
| 524 |
|
| 525 |
Length = self.vLightSourceToCamera.Magnitude () # // Save the length we will need it in a minute |
| 526 |
|
| 527 |
# Move down our look-toward direction vector. Move down the look-toward the same dist. as the
|
| 528 |
# distance between camera and the light.
|
| 529 |
intersect = self.m_DirectionVector * Length
|
| 530 |
self.m_ptIntersect = glPoint (intersect.i, intersect.j, intersect.k)
|
| 531 |
# // Now lets find an point along the cameras direction
|
| 532 |
# // vector that we can use as an intersection point.
|
| 533 |
# // Lets translate down this vector the same distance
|
| 534 |
# // that the camera is away from the light source.
|
| 535 |
ptIntersect = self.m_ptIntersect
|
| 536 |
# Did the motion in the correct direction above, now translate the intersection position
|
| 537 |
# relative to our camera location.
|
| 538 |
ptIntersect += self.m_Position;
|
| 539 |
|
| 540 |
|
| 541 |
self.vLightSourceToIntersect = ptIntersect - self.m_LightSourcePos; # // Lets compute the vector that points to the Intersect |
| 542 |
# // point from the light source
|
| 543 |
|
| 544 |
Length = self.vLightSourceToIntersect.Magnitude(); # // Save the length we will need it later. |
| 545 |
self.vLightSourceToIntersect.Normalize(); # // Normalize the vector so its unit length |
| 546 |
vLightSourceToIntersect = self.vLightSourceToIntersect
|
| 547 |
|
| 548 |
glEnable(GL_BLEND); # // You should already know what this does
|
| 549 |
glBlendFunc(GL_SRC_ALPHA, GL_ONE); # // You should already know what this does
|
| 550 |
glDisable(GL_DEPTH_TEST); # // You should already know what this does
|
| 551 |
glEnable(GL_TEXTURE_2D); # // You should already know what this does
|
| 552 |
|
| 553 |
# /////////// Differenet Color Glows & Streaks /////////////////////
|
| 554 |
# //RenderBigGlow(1.0f, 1.0f, 1.0f, 1.0f, m_LightSourcePos, 1.0f);
|
| 555 |
# //RenderStreaks(1.0f, 1.0f, 0.8f, 1.0f, m_LightSourcePos, 0.7f);
|
| 556 |
# //
|
| 557 |
# //RenderBigGlow(1.0f, 0.9f, 1.0f, 1.0f, m_LightSourcePos, 1.0f);
|
| 558 |
# //RenderStreaks(1.0f, 0.9f, 1.0f, 1.0f, m_LightSourcePos, 0.7f);
|
| 559 |
# //////////////////////////////////////////////////////////////////
|
| 560 |
|
| 561 |
|
| 562 |
# //########################## NEW STUFF ##################################
|
| 563 |
|
| 564 |
if (not self.IsOccluded(self.m_LightSourcePos)): # //Check if the center of the flare is occluded |
| 565 |
# // Render the large hazy glow
|
| 566 |
self.RenderBigGlow(0.60, 0.60, 0.8, 1.0, self.m_LightSourcePos, 16.0); |
| 567 |
# // Render the streaks
|
| 568 |
self.RenderStreaks(0.60, 0.60, 0.8, 1.0, self.m_LightSourcePos, 16.0); |
| 569 |
# // Render the small Glow
|
| 570 |
self.RenderGlow(0.8, 0.8, 1.0, 0.5, self.m_LightSourcePos, 3.5); |
| 571 |
|
| 572 |
pt = glPoint (vLightSourceToIntersect * (Length * 0.1)); # // Lets compute a point that is 20% |
| 573 |
pt += self.m_LightSourcePos; # // away from the light source in the |
| 574 |
# // direction of the intersection point.
|
| 575 |
|
| 576 |
self.RenderGlow(0.9, 0.6, 0.4, 0.5, pt, 0.6); # // Render the small Glow |
| 577 |
|
| 578 |
pt = glPoint (vLightSourceToIntersect * (Length * 0.15)); # // Lets compute a point that is 30% |
| 579 |
pt += self.m_LightSourcePos; # // away from the light source in the |
| 580 |
# // direction of the intersection point.
|
| 581 |
|
| 582 |
self.RenderHalo(0.8, 0.5, 0.6, 0.5, pt, 1.7); # // Render the a Halo |
| 583 |
|
| 584 |
pt = glPoint (vLightSourceToIntersect * (Length * 0.175)); # // Lets compute a point that is 35% |
| 585 |
pt += self.m_LightSourcePos; # // away from the light source in the |
| 586 |
# // direction of the intersection point.
|
| 587 |
|
| 588 |
self.RenderHalo(0.9, 0.2, 0.1, 0.5, pt, 0.83); # // Render the a Halo |
| 589 |
|
| 590 |
pt = glPoint (vLightSourceToIntersect * (Length * 0.285)); # // Lets compute a point that is 57% |
| 591 |
pt += self.m_LightSourcePos; # // away from the light source in the |
| 592 |
# // direction of the intersection point.
|
| 593 |
|
| 594 |
self.RenderHalo(0.7, 0.7, 0.4, 0.5, pt, 1.6); # // Render the a Halo |
| 595 |
|
| 596 |
pt = glPoint (vLightSourceToIntersect * (Length * 0.2755)); # // Lets compute a point that is 55.1% |
| 597 |
pt += self.m_LightSourcePos; # // away from the light source in the |
| 598 |
# // direction of the intersection point.
|
| 599 |
|
| 600 |
self.RenderGlow(0.9, 0.9, 0.2, 0.5, pt, 0.8); # // Render the small Glow |
| 601 |
|
| 602 |
pt = glPoint (vLightSourceToIntersect * (Length * 0.4775)); # // Lets compute a point that is 95.5% |
| 603 |
pt += self.m_LightSourcePos; # // away from the light source in the |
| 604 |
# // direction of the intersection point.
|
| 605 |
|
| 606 |
self.RenderGlow(0.93, 0.82, 0.73, 0.5, pt, 1.0); # // Render the small Glow |
| 607 |
|
| 608 |
pt = glPoint (vLightSourceToIntersect * (Length * 0.49)); # // Lets compute a point that is 98% |
| 609 |
pt += self.m_LightSourcePos; # // away from the light source in the |
| 610 |
# // direction of the intersection point.
|
| 611 |
|
| 612 |
self.RenderHalo(0.7, 0.6, 0.5, 0.5, pt, 1.4); # // Render the a Halo |
| 613 |
|
| 614 |
pt = glPoint (vLightSourceToIntersect * (Length * 0.65)); # // Lets compute a point that is 130% |
| 615 |
pt += self.m_LightSourcePos; # // away from the light source in the |
| 616 |
# // direction of the intersection point.
|
| 617 |
|
| 618 |
self.RenderGlow(0.7, 0.8, 0.3, 0.5, pt, 1.8); # // Render the small Glow |
| 619 |
|
| 620 |
pt = glPoint (vLightSourceToIntersect * (Length * 0.63)); # // Lets compute a point that is 126% |
| 621 |
pt += self.m_LightSourcePos; # // away from the light source in the |
| 622 |
# // direction of the intersection point.
|
| 623 |
|
| 624 |
self.RenderGlow(0.4, 0.3, 0.2, 0.5, pt, 1.4); # // Render the small Glow |
| 625 |
|
| 626 |
pt = glPoint (vLightSourceToIntersect * (Length * 0.8)); # // Lets compute a point that is 160% |
| 627 |
pt += self.m_LightSourcePos; # // away from the light source in the |
| 628 |
# // direction of the intersection point.
|
| 629 |
|
| 630 |
self.RenderHalo(0.7, 0.5, 0.5, 0.5, pt, 1.4); # // Render the a Halo |
| 631 |
|
| 632 |
pt = glPoint (vLightSourceToIntersect * (Length * 0.7825)); # // Lets compute a point that is 156.5% |
| 633 |
pt += self.m_LightSourcePos; # // away from the light source in the |
| 634 |
# // direction of the intersection point.
|
| 635 |
|
| 636 |
self.RenderGlow(0.8, 0.5, 0.1, 0.5, pt, 0.6); # // Render the small Glow |
| 637 |
|
| 638 |
pt = glPoint (vLightSourceToIntersect * (Length * 1.0)); # // Lets compute a point that is 200% |
| 639 |
pt += self.m_LightSourcePos; # // away from the light source in the |
| 640 |
# // direction of the intersection point.
|
| 641 |
|
| 642 |
self.RenderHalo(0.5, 0.5, 0.7, 0.5, pt, 1.7); # // Render the a Halo |
| 643 |
|
| 644 |
pt = glPoint (vLightSourceToIntersect * (Length * 0.975)); # // Lets compute a point that is 195% |
| 645 |
pt += self.m_LightSourcePos; # // away from the light source in the |
| 646 |
# // direction of the intersection point.
|
| 647 |
|
| 648 |
self.RenderGlow(0.4, 0.1, 0.9, 0.5, pt, 2.0); # // Render the small Glow |
| 649 |
|
| 650 |
glDisable(GL_BLEND ); # // You should already know what this does
|
| 651 |
glEnable(GL_DEPTH_TEST); # // You should already know what this does
|
| 652 |
glDisable(GL_TEXTURE_2D); # // You should already know what this does
|
| 653 |
return
|
| 654 |
|
| 655 |
def RenderHalo (self, r, g, b, a, p, scale): |
| 656 |
self.RenderFlareTexture (self.m_HaloTexture, r, g, b, a, p, scale) |
| 657 |
return
|
| 658 |
|
| 659 |
def RenderGlow (self, r, g, b, a, p, scale): |
| 660 |
self.RenderFlareTexture (self.m_GlowTexture, r, g, b, a, p, scale) |
| 661 |
return
|
| 662 |
|
| 663 |
def RenderBigGlow (self, r, g, b, a, p, scale): |
| 664 |
self.RenderFlareTexture (self.m_BigGlowTexture, r, g, b, a, p, scale) |
| 665 |
return
|
| 666 |
|
| 667 |
def RenderStreaks (self, r, g, b, a, p, scale): |
| 668 |
self.RenderFlareTexture (self.m_StreakTexture, r, g, b, a, p, scale) |
| 669 |
return
|
| 670 |
|
| 671 |
def RenderFlareTexture (self, tex_ID, r, g, b, a, p, scale): |
| 672 |
# bleair: Duplicate functions all the same except for the texture to bind to.
|
| 673 |
|
| 674 |
q = [] |
| 675 |
q.append (glPoint ()) |
| 676 |
q.append (glPoint ()) |
| 677 |
q.append (glPoint ()) |
| 678 |
q.append (glPoint ()) |
| 679 |
# // Basically we are just going to make a 2D box
|
| 680 |
# // from four points we don't need a z coord because
|
| 681 |
# // we are rotating the camera by the inverse so the
|
| 682 |
# // texture mapped quads will always face us.
|
| 683 |
|
| 684 |
q[0].x = (p.x - scale); # // Set the x coordinate -scale units from the center point. |
| 685 |
q[0].y = (p.y - scale); # // Set the y coordinate -scale units from the center point. |
| 686 |
|
| 687 |
q[1].x = (p.x - scale); # // Set the x coordinate -scale units from the center point. |
| 688 |
q[1].y = (p.y + scale); # // Set the y coordinate scale units from the center point. |
| 689 |
|
| 690 |
q[2].x = (p.x + scale); # // Set the x coordinate scale units from the center point. |
| 691 |
q[2].y = (p.y - scale); # // Set the y coordinate -scale units from the center point. |
| 692 |
|
| 693 |
q[3].x = (p.x + scale); # // Set the x coordinate scale units from the center point. |
| 694 |
q[3].y = (p.y + scale); # // Set the y coordinate scale units from the center point. |
| 695 |
|
| 696 |
glPushMatrix(); # // Save the model view matrix
|
| 697 |
glTranslatef(p.x, p.y, p.z); # // Translate to our point
|
| 698 |
glRotatef(-self.m_HeadingDegrees, 0.0, 1.0, 0.0); |
| 699 |
glRotatef(-self.m_PitchDegrees, 1.0, 0.0, 0.0); |
| 700 |
glBindTexture(GL_TEXTURE_2D, tex_ID); # // Bind to the Big Glow texture
|
| 701 |
glColor4f(r, g, b, a); # // Set the color since the texture is a gray scale
|
| 702 |
|
| 703 |
glBegin(GL_TRIANGLE_STRIP); # // Draw the Big Glow on a Triangle Strip
|
| 704 |
glTexCoord2f(0.0, 0.0); |
| 705 |
glVertex2f(q[0].x, q[0].y); |
| 706 |
glTexCoord2f(0.0, 1.0); |
| 707 |
glVertex2f(q[1].x, q[1].y); |
| 708 |
glTexCoord2f(1.0, 0.0); |
| 709 |
glVertex2f(q[2].x, q[2].y); |
| 710 |
glTexCoord2f(1.0, 1.0); |
| 711 |
glVertex2f(q[3].x, q[3].y); |
| 712 |
glEnd(); |
| 713 |
glPopMatrix(); # // Restore the model view matrix
|
| 714 |
return
|
| 715 |
|
| 716 |
|
| 717 |
|
| 718 |
|
| 719 |
def SetPrespective (self): |
| 720 |
# Matrix = [0] * 16 # // A (list) array to hold the model view matrix.
|
| 721 |
|
| 722 |
# However the MODELVIEW was oriented, we now rotate it based upon our Camer object's state.
|
| 723 |
# // Going to use glRotate to calculate our direction vector
|
| 724 |
glRotatef(self.m_HeadingDegrees, 0.0, 1.0, 0.0); # turn your head left/right (around y axe) |
| 725 |
glRotatef(self.m_PitchDegrees, 1.0, 0.0, 0.0); # nod your head up/down (around x axe) |
| 726 |
|
| 727 |
# // Get the resulting matrix from OpenGL it will have our
|
| 728 |
# // direction vector in the 3rd row.
|
| 729 |
Matrix = glGetFloatv(GL_MODELVIEW_MATRIX); |
| 730 |
|
| 731 |
# // Get the direction vector from the matrix. Element 10 must
|
| 732 |
# // be inverted!
|
| 733 |
self.m_DirectionVector.i = Matrix[2] [0] #[8]; |
| 734 |
self.m_DirectionVector.j = Matrix[2] [1] #[9]; |
| 735 |
self.m_DirectionVector.k = -Matrix[2] [2] #[10]; |
| 736 |
|
| 737 |
# #### bleair: no need to do this as this. Previous rotates already here (because
|
| 738 |
# #### all invocations have the modelview at identity.
|
| 739 |
# #### Suspect this was just a bit of code that was mvoed up and not deleted here.
|
| 740 |
# // Ok erase the results of the last computation.
|
| 741 |
glLoadIdentity(); |
| 742 |
|
| 743 |
# // Rotate the scene to get the right orientation.
|
| 744 |
glRotatef(self.m_PitchDegrees, 1.0, 0.0, 0.0); |
| 745 |
glRotatef(self.m_HeadingDegrees, 0.0, 1.0, 0.0); |
| 746 |
|
| 747 |
# // A vector to hold our cameras direction * the forward velocity
|
| 748 |
# // we don't want to destory the Direction vector by using it instead.
|
| 749 |
# // Scale the direction by our speed.
|
| 750 |
v = copy.copy (self.m_DirectionVector);
|
| 751 |
v *= self.m_ForwardVelocity;
|
| 752 |
|
| 753 |
# // Increment our position by the vector
|
| 754 |
self.m_Position.x += v.i;
|
| 755 |
self.m_Position.y += v.j;
|
| 756 |
self.m_Position.z += v.k;
|
| 757 |
|
| 758 |
# // Translate to our new position.
|
| 759 |
glTranslatef(-self.m_Position.x, -self.m_Position.y, -self.m_Position.z); |
| 760 |
return
|
| 761 |
|
| 762 |
|
| 763 |
"""
|
| 764 |
//////////// MEMBER VARIBLES //////////////////////////////////////
|
| 765 |
glVector vLightSourceToCamera, vLightSourceToIntersect;
|
| 766 |
glPoint ptIntersect, pt;
|
| 767 |
GLsizei m_WindowHeight;
|
| 768 |
GLsizei m_WindowWidth;
|
| 769 |
GLuint m_StreakTexture;
|
| 770 |
GLuint m_HaloTexture;
|
| 771 |
GLuint m_GlowTexture;
|
| 772 |
GLuint m_BigGlowTexture;
|
| 773 |
GLfloat m_MaxPointSize;
|
| 774 |
GLfloat m_Frustum[6][4];
|
| 775 |
glPoint m_LightSourcePos;
|
| 776 |
GLfloat m_MaxPitchRate;
|
| 777 |
GLfloat m_MaxHeadingRate;
|
| 778 |
GLfloat m_HeadingDegrees;
|
| 779 |
GLfloat m_PitchDegrees;
|
| 780 |
GLfloat m_MaxForwardVelocity;
|
| 781 |
GLfloat m_ForwardVelocity;
|
| 782 |
glPoint m_Position;
|
| 783 |
glVector m_DirectionVector;
|
| 784 |
"""
|
| 785 |
|