From afdd54fa3720c267f30e48ed45c449d80449bac0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 4 Apr 2007 13:18:41 +0000 Subject: moved source and text to american spelling * colour -> color * centre -> center * normalise -> normalize * modelling -> modeling --- source/gameengine/Ketsji/KX_Camera.cpp | 54 ++++++++++++------------ source/gameengine/Ketsji/KX_Camera.h | 18 ++++---- source/gameengine/Ketsji/KX_CameraActuator.cpp | 8 ++-- source/gameengine/Ketsji/KX_Light.cpp | 10 ++--- source/gameengine/Ketsji/KX_MouseFocusSensor.cpp | 6 +-- source/gameengine/Ketsji/KX_Scene.cpp | 4 +- source/gameengine/Ketsji/KX_VertexProxy.cpp | 6 +-- 7 files changed, 53 insertions(+), 53 deletions(-) (limited to 'source/gameengine/Ketsji') diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 674528f719c..011443054a7 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -48,10 +48,10 @@ KX_Camera::KX_Camera(void* sgReplicationInfo, KX_GameObject(sgReplicationInfo,callbacks,T), m_camdata(camdata), m_dirty(true), - m_normalised(false), + m_normalized(false), m_frustum_culling(frustum_culling && camdata.m_perspective), m_set_projection_matrix(false), - m_set_frustum_centre(false) + m_set_frustum_center(false) { // setting a name would be nice... m_name = "cam"; @@ -120,7 +120,7 @@ void KX_Camera::SetProjectionMatrix(const MT_Matrix4x4 & mat) m_projection_matrix = mat; m_dirty = true; m_set_projection_matrix = true; - m_set_frustum_centre = false; + m_set_frustum_center = false; } @@ -132,7 +132,7 @@ void KX_Camera::SetModelviewMatrix(const MT_Matrix4x4 & mat) { m_modelview_matrix = mat; m_dirty = true; - m_set_frustum_centre = false; + m_set_frustum_center = false; } @@ -216,12 +216,12 @@ void KX_Camera::ExtractClipPlanes() m_planes[5] = m[3] - m[2]; m_dirty = false; - m_normalised = false; + m_normalized = false; } -void KX_Camera::NormaliseClipPlanes() +void KX_Camera::NormalizeClipPlanes() { - if (m_normalised) + if (m_normalized) return; for (unsigned int p = 0; p < 6; p++) @@ -231,15 +231,15 @@ void KX_Camera::NormaliseClipPlanes() m_planes[p] /= factor; } - m_normalised = true; + m_normalized = true; } void KX_Camera::ExtractFrustumSphere() { - if (m_set_frustum_centre) + if (m_set_frustum_center) return; - // The most extreme points on the near and far plane. (normalised device coords) + // The most extreme points on the near and far plane. (normalized device coords) MT_Vector4 hnear(1., 1., 0., 1.), hfar(1., 1., 1., 1.); MT_Matrix4x4 clip_camcs_matrix = m_projection_matrix; clip_camcs_matrix.invert(); @@ -252,16 +252,16 @@ void KX_Camera::ExtractFrustumSphere() MT_Point3 nearpoint(hnear[0]/hnear[3], hnear[1]/hnear[3], hnear[2]/hnear[3]); MT_Point3 farpoint(hfar[0]/hfar[3], hfar[1]/hfar[3], hfar[2]/hfar[3]); - // Compute centre - m_frustum_centre = MT_Point3(0., 0., + // Compute center + m_frustum_center = MT_Point3(0., 0., (nearpoint.dot(nearpoint) - farpoint.dot(farpoint))/(2.0*(m_camdata.m_clipend - m_camdata.m_clipstart))); - m_frustum_radius = m_frustum_centre.distance(farpoint); + m_frustum_radius = m_frustum_center.distance(farpoint); // Transform to world space. - m_frustum_centre = GetCameraToWorld()(m_frustum_centre); + m_frustum_center = GetCameraToWorld()(m_frustum_center); m_frustum_radius /= fabs(NodeGetWorldScaling()[NodeGetWorldScaling().closestAxis()]); - m_set_frustum_centre = true; + m_set_frustum_center = true; } bool KX_Camera::PointInsideFrustum(const MT_Point3& x) @@ -308,15 +308,15 @@ int KX_Camera::BoxInsideFrustum(const MT_Point3 *box) return INTERSECT; } -int KX_Camera::SphereInsideFrustum(const MT_Point3& centre, const MT_Scalar &radius) +int KX_Camera::SphereInsideFrustum(const MT_Point3& center, const MT_Scalar &radius) { ExtractFrustumSphere(); - if (centre.distance2(m_frustum_centre) > (radius + m_frustum_radius)*(radius + m_frustum_radius)) + if (center.distance2(m_frustum_center) > (radius + m_frustum_radius)*(radius + m_frustum_radius)) return OUTSIDE; unsigned int p; ExtractClipPlanes(); - NormaliseClipPlanes(); + NormalizeClipPlanes(); MT_Scalar distance; int intersect = INSIDE; @@ -324,7 +324,7 @@ int KX_Camera::SphereInsideFrustum(const MT_Point3& centre, const MT_Scalar &rad // -radius radius for (p = 0; p < 6; p++) { - distance = m_planes[p][0]*centre[0] + m_planes[p][1]*centre[1] + m_planes[p][2]*centre[2] + m_planes[p][3]; + distance = m_planes[p][0]*center[0] + m_planes[p][1]*center[1] + m_planes[p][2]*center[2] + m_planes[p][3]; if (fabs(distance) <= radius) intersect = INTERSECT; else if (distance < -radius) @@ -537,10 +537,10 @@ int KX_Camera::_setattr(const STR_String &attr, PyObject *pyvalue) } KX_PYMETHODDEF_DOC(KX_Camera, sphereInsideFrustum, -"sphereInsideFrustum(centre, radius) -> Integer\n" +"sphereInsideFrustum(center, radius) -> Integer\n" "\treturns INSIDE, OUTSIDE or INTERSECT if the given sphere is\n" "\tinside/outside/intersects this camera's viewing frustum.\n\n" -"\tcentre = the centre of the sphere (in world coordinates.)\n" +"\tcenter = the center of the sphere (in world coordinates.)\n" "\tradius = the radius of the sphere\n\n" "\tExample:\n" "\timport GameLogic\n\n" @@ -554,18 +554,18 @@ KX_PYMETHODDEF_DOC(KX_Camera, sphereInsideFrustum, "\t\t# Sphere is outside frustum\n" ) { - PyObject *pycentre; + PyObject *pycenter; float radius; - if (PyArg_ParseTuple(args, "Of", &pycentre, &radius)) + if (PyArg_ParseTuple(args, "Of", &pycenter, &radius)) { - MT_Point3 centre; - if (PyVecTo(pycentre, centre)) + MT_Point3 center; + if (PyVecTo(pycenter, center)) { - return PyInt_FromLong(SphereInsideFrustum(centre, radius)); /* new ref */ + return PyInt_FromLong(SphereInsideFrustum(center, radius)); /* new ref */ } } - PyErr_SetString(PyExc_TypeError, "sphereInsideFrustum: Expected arguments: (centre, radius)"); + PyErr_SetString(PyExc_TypeError, "sphereInsideFrustum: Expected arguments: (center, radius)"); Py_Return; } diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index ed926f12123..60f0b107940 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -83,9 +83,9 @@ protected: */ bool m_dirty; /** - * true if the frustum planes have been normalised. + * true if the frustum planes have been normalized. */ - bool m_normalised; + bool m_normalized; /** * View Frustum clip planes. @@ -104,11 +104,11 @@ protected: bool m_set_projection_matrix; /** - * The centre point of the frustum. + * The center point of the frustum. */ - MT_Point3 m_frustum_centre; + MT_Point3 m_frustum_center; MT_Scalar m_frustum_radius; - bool m_set_frustum_centre; + bool m_set_frustum_center; /** * Python module doc string. @@ -120,9 +120,9 @@ protected: */ void ExtractClipPlanes(); /** - * Normalise the camera clip frames. + * Normalize the camera clip frames. */ - void NormaliseClipPlanes(); + void NormalizeClipPlanes(); /** * Extracts the bound sphere of the view frustum. */ @@ -181,11 +181,11 @@ public: /** * Tests if the given sphere is inside this camera's view frustum. * - * @param centre The centre of the sphere, in world coordinates. + * @param center The center of the sphere, in world coordinates. * @param radius The radius of the sphere. * @return INSIDE, INTERSECT, or OUTSIDE depending on the sphere's relation to the frustum. */ - int SphereInsideFrustum(const MT_Point3& centre, const MT_Scalar &radius); + int SphereInsideFrustum(const MT_Point3& center, const MT_Scalar &radius); /** * Tests the given eight corners of a box with the view frustum. * diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index dba4792c83c..9454e21132a 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -89,12 +89,12 @@ GetReplica( /* three functions copied from blender arith... don't know if there's an equivalent */ -static float Kx_Normalise(float *n) +static float Kx_Normalize(float *n) { float d; d= n[0]*n[0]+n[1]*n[1]+n[2]*n[2]; - /* FLT_EPSILON is too large! A larger value causes normalise errors in a scaled down utah teapot */ + /* FLT_EPSILON is too large! A larger value causes normalize errors in a scaled down utah teapot */ if(d>0.0000000000001) { d= sqrt(d); @@ -158,14 +158,14 @@ static void Kx_VecUpMat3(float *vec, float mat[][3], short axis) mat[coz][0]= vec[0]; mat[coz][1]= vec[1]; mat[coz][2]= vec[2]; - Kx_Normalise((float *)mat[coz]); + Kx_Normalize((float *)mat[coz]); inp= mat[coz][2]; mat[coy][0]= - inp*mat[coz][0]; mat[coy][1]= - inp*mat[coz][1]; mat[coy][2]= 1.0 - inp*mat[coz][2]; - Kx_Normalise((float *)mat[coy]); + Kx_Normalize((float *)mat[coy]); Kx_Crossf(mat[cox], mat[coy], mat[coz]); diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp index 06a52c07b3f..4a92ea4ac13 100644 --- a/source/gameengine/Ketsji/KX_Light.cpp +++ b/source/gameengine/Ketsji/KX_Light.cpp @@ -191,12 +191,12 @@ int KX_LightObject::_setattr(const STR_String& attr, PyObject *pyvalue) { if (attr == "colour" || attr == "color") { - MT_Vector3 colour; - if (PyVecTo(pyvalue, colour)) + MT_Vector3 color; + if (PyVecTo(pyvalue, color)) { - m_lightobj.m_red = colour[0]; - m_lightobj.m_green = colour[1]; - m_lightobj.m_blue = colour[2]; + m_lightobj.m_red = color[0]; + m_lightobj.m_green = color[1]; + m_lightobj.m_blue = color[2]; return 0; } return 1; diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index 0d383376d87..431efa07e0a 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -164,7 +164,7 @@ bool KX_MouseFocusSensor::ParentObjectHasFocus(void) * -> wcs_camcs_trafo -> * camCS - camera coordinates * -> camcs_clip_trafo -> - * clipCS - normalised device coordinates? + * clipCS - normalized device coordinates? * -> normview_win_trafo * winCS - window coordinates * @@ -172,7 +172,7 @@ bool KX_MouseFocusSensor::ParentObjectHasFocus(void) * the projection matrix. These are passed to the rasterizer, and * we store them in the camera for easy access. * - * For normalised device coords (xn = x/w, yn = y/w/zw) the + * For normalized device coords (xn = x/w, yn = y/w/zw) the * windows coords become (lb = left bottom) * * xwin = [(xn + 1.0) * width]/2 + x_lb @@ -215,7 +215,7 @@ bool KX_MouseFocusSensor::ParentObjectHasFocus(void) float nearclip = 0.0; float farclip = 1.0; - /* build the from and to point in normalised device coordinates + /* build the from and to point in normalized device coordinates * Looks like normailized device coordinates are [-1,1] in x [-1,1] in y * [0,-1] in z * diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index a5bbfa41e3e..996c605df21 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -919,9 +919,9 @@ void KX_Scene::MarkVisible(SG_Tree *node, RAS_IRasterizer* rasty, KX_Camera* cam if (dotest && !node->inside( cam->NodeGetWorldPosition())) { MT_Scalar radius = node->Radius(); - MT_Point3 centre = node->Centre(); + MT_Point3 center = node->Center(); - intersect = cam->SphereInsideFrustum(centre, radius); + intersect = cam->SphereInsideFrustum(center, radius); if (intersect == KX_Camera::INTERSECT) { diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index cacf3987e63..9c5f3f611b6 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -93,9 +93,9 @@ KX_VertexProxy::_getattr(const STR_String& attr) if (attr == "colour" || attr == "color") { const unsigned char *colp = m_vertex->getRGBA(); - MT_Vector4 colour(colp[0], colp[1], colp[2], colp[3]); - colour /= 255.0; - return PyObjectFrom(colour); + MT_Vector4 color(colp[0], colp[1], colp[2], colp[3]); + color /= 255.0; + return PyObjectFrom(color); } if (attr == "normal") -- cgit v1.2.3