# PySoy Scenes Declarations # # Copyright (C) 2006,2007,2008 PySoy Group # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program; if not, see http://www.gnu.org/licenses # # $Id$ cimport gl cimport glib cimport ode cimport py cimport math cimport soy._internals cimport soy._datatypes cimport soy.colors cimport soy.materials cdef : struct Face : unsigned short a unsigned short b unsigned short c struct Quad : unsigned int a unsigned int b unsigned int c unsigned int d struct Vert : float px float py float pz float nx float ny float nz float tx float ty float tz float ux float uy float uz cdef void _prerunField(void*, void*, void*) nogil cdef void _runField(void*, void*, void*) nogil cdef class Scene (soy._internals.Loopable) : cdef ode.dWorldID _worldID cdef ode.dSpaceID _spaceID cdef ode.dJointGroupID _contactGroup cdef soy._internals.Children _bodies cdef soy._internals.Children _fields cdef soy._internals.Children _joints cdef soy._internals.Children _lights cdef soy._internals.PointerSet _giveFields cdef soy._internals.PointerSet _callFields cdef soy.colors.Color _ambient cdef float _fogDensity cdef void* _stepMutex cdef void _stepLock ( self ) nogil cdef int _stepTryLock ( self ) nogil cdef void _stepUnLock ( self ) nogil cdef ode.dReal _stepSize cdef ode.dReal _friction cdef double _prevTime cdef double _time # _coreloop methods cdef void _render ( self, gl.GLdouble, gl.GLdouble, gl.GLdouble, gl.GLdouble ) cdef int _steps ( self ) nogil cdef void _callback ( self, ode.dGeomID, ode.dGeomID ) nogil cdef class Landscape (Scene) : cdef ode.dGeomID _geomID cdef ode.dHeightfieldDataID _heightfieldDataID cdef float _position[3] cdef float _width cdef float _height cdef float _depth cdef soy.textures.Texture _pyMap cdef soy.textures.Texture _tzMap cdef soy.materials.Material _material cdef Vert* _vertArray cdef gl.GLuint _vertBuffer cdef Vert* _backArray cdef gl.GLuint _backBuffer cdef Quad* _faceArray cdef gl.GLuint _faceBuffer cdef void _createBuffer ( self ) cdef void _createArrays ( self ) cdef class Planar (Scene) : cdef ode.dGeomID _planeID cdef float _offset cdef soy.materials.Material _material cdef Vert _verts[60] cdef Face _faces[40] cdef Vert _midpoint(self, Vert, Vert)