scenejs icon indicating copy to clipboard operation
scenejs copied to clipboard

SceneJS creates a lot of global variables

Open tsherif opened this issue 9 years ago • 1 comments

In working with some of the examples, I noticed that SceneJS creates a lot of global variables. In the Quick Start teapot, for example, SceneJS creates the 138 global variables listed below.

The naming convention used for these variables lends itself well to modularization. I could imaging the library creating a single SceneJS object with everything else nested as properties of that object, e.g. SceneJS_Canvas becomes SceneJS.Canvas, SceneJS_error becomes SceneJS.error, SceneJS_math_Frustum becomes SceneJS.math.Frustum, etc. This could make it much cleaner to include SceneJS in other pages.

The full list of global variables created by SceneJS in the teapot example:

  • SceneJS
  • SceneJS_Canvas
  • SceneJS_Chunk
  • SceneJS_ChunkFactory
  • SceneJS_Core
  • SceneJS_CoreFactory
  • SceneJS_Display
  • SceneJS_Engine
  • SceneJS_Map
  • SceneJS_NodeFactory
  • SceneJS_Object
  • SceneJS_ObjectFactory
  • SceneJS_Program
  • SceneJS_ProgramFactory
  • SceneJS_ProgramSource
  • SceneJS_ProgramSourceFactory
  • SceneJS_PubSubProxy
  • SceneJS_configsModule
  • SceneJS_error
  • SceneJS_eventManager
  • SceneJS_events
  • SceneJS_math_AxisBox3
  • SceneJS_math_Box3
  • SceneJS_math_Frustum
  • SceneJS_math_FrustumPlane
  • SceneJS_math_INSIDE_FRUSTUM
  • SceneJS_math_INTERSECT_FRUSTUM
  • SceneJS_math_LOOKAT_ARRAYS
  • SceneJS_math_LOOKAT_OBJ
  • SceneJS_math_MAX_DOUBLE
  • SceneJS_math_MIN_DOUBLE
  • SceneJS_math_ORTHO_OBJ
  • SceneJS_math_OUTSIDE_FRUSTUM
  • SceneJS_math_Plane3
  • SceneJS_math_Sphere3
  • SceneJS_math_addMat4
  • SceneJS_math_addMat4Scalar
  • SceneJS_math_addScalarMat4
  • SceneJS_math_addScalarVec4
  • SceneJS_math_addVec3
  • SceneJS_math_addVec3s
  • SceneJS_math_addVec4
  • SceneJS_math_addVec4s
  • SceneJS_math_angleAxisFromQuaternion
  • SceneJS_math_angleAxisQuaternion
  • SceneJS_math_billboardMat
  • SceneJS_math_conjugateQuaternion
  • SceneJS_math_cross3Vec3
  • SceneJS_math_cross3Vec4
  • SceneJS_math_determinantMat4
  • SceneJS_math_diagonalMat4c
  • SceneJS_math_diagonalMat4s
  • SceneJS_math_diagonalMat4v
  • SceneJS_math_divScalarVec3
  • SceneJS_math_divScalarVec4
  • SceneJS_math_divVec3
  • SceneJS_math_divVec3s
  • SceneJS_math_divVec4
  • SceneJS_math_divVec4s
  • SceneJS_math_dotVector2
  • SceneJS_math_dotVector3
  • SceneJS_math_dotVector4
  • SceneJS_math_dupMat4
  • SceneJS_math_frustumMat4v
  • SceneJS_math_frustumMatrix4
  • SceneJS_math_getCellMat4
  • SceneJS_math_getColMat4
  • SceneJS_math_getRowMat4
  • SceneJS_math_identityMat4
  • SceneJS_math_identityQuaternion
  • SceneJS_math_inverseMat4
  • SceneJS_math_isIdentityMat4
  • SceneJS_math_lenVec2
  • SceneJS_math_lenVec3
  • SceneJS_math_lenVec4
  • SceneJS_math_lerpVec3
  • SceneJS_math_lookAtMat4c
  • SceneJS_math_lookAtMat4v
  • SceneJS_math_m4s
  • SceneJS_math_mat4
  • SceneJS_math_mat4To3
  • SceneJS_math_mulMat4
  • SceneJS_math_mulMat4s
  • SceneJS_math_mulMat4v4
  • SceneJS_math_mulQuaternions
  • SceneJS_math_mulVec2Scalar
  • SceneJS_math_mulVec3Scalar
  • SceneJS_math_mulVec4
  • SceneJS_math_mulVec4Scalar
  • SceneJS_math_negateMat4
  • SceneJS_math_negateVector4
  • SceneJS_math_newMat4FromQuaternion
  • SceneJS_math_normalizeQuaternion
  • SceneJS_math_normalizeVec2
  • SceneJS_math_normalizeVec3
  • SceneJS_math_normalizeVec4
  • SceneJS_math_orthoMat4c
  • SceneJS_math_perspectiveMatrix4
  • SceneJS_math_projectVec4
  • SceneJS_math_rcpVec3
  • SceneJS_math_rotationMat4c
  • SceneJS_math_rotationMat4v
  • SceneJS_math_scalingMat4c
  • SceneJS_math_scalingMat4s
  • SceneJS_math_scalingMat4v
  • SceneJS_math_setCellMat4
  • SceneJS_math_setColMat4Scalar
  • SceneJS_math_setColMat4c
  • SceneJS_math_setColMat4v
  • SceneJS_math_setMat4ToOnes
  • SceneJS_math_setMat4ToZeroes
  • SceneJS_math_setRowMat4
  • SceneJS_math_setRowMat4c
  • SceneJS_math_setRowMat4s
  • SceneJS_math_slerp
  • SceneJS_math_sqLenVec2
  • SceneJS_math_sqLenVec3
  • SceneJS_math_sqLenVec4
  • SceneJS_math_subMat4
  • SceneJS_math_subMat4Scalar
  • SceneJS_math_subScalarMat4
  • SceneJS_math_subScalarVec4
  • SceneJS_math_subVec2
  • SceneJS_math_subVec3
  • SceneJS_math_subVec4
  • SceneJS_math_subVec4Scalar
  • SceneJS_math_traceMat4
  • SceneJS_math_transformPoint3
  • SceneJS_math_transformPoints3
  • SceneJS_math_transformVector3
  • SceneJS_math_transformVector4
  • SceneJS_math_translationMat4c
  • SceneJS_math_translationMat4s
  • SceneJS_math_translationMat4v
  • SceneJS_math_transposeMat4
  • SceneJS_modelXFormStack
  • SceneJS_nodeEventsModule
  • SceneJS_sceneStatusModule

tsherif avatar Jan 23 '15 19:01 tsherif