mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-25 16:26:18 +00:00
Changed: #878 Fix typos in comments/code
This commit is contained in:
parent
ef5dc445fe
commit
6bf4f1a80a
8 changed files with 24 additions and 24 deletions
|
@ -51,7 +51,7 @@ public:
|
|||
public:
|
||||
/// Name of the shape to use.
|
||||
std::string ShapeName;
|
||||
/// Density== Number of instance to create / m².
|
||||
/// Density== Number of instance to create / m^2.
|
||||
NLMISC::CNoiseValue Density; // floor(Density*surface)== nbShape to create.
|
||||
/// the maximum density computed. if <0, no maximum. -1 by default.
|
||||
float MaxDensity;
|
||||
|
|
|
@ -276,7 +276,7 @@ void CTessFace::updateErrorMetric()
|
|||
ErrorMetric= Size/ sqrdist;
|
||||
|
||||
|
||||
// Hoppe97 formula: k˛= a˛ * ("v-e"˛ - ((v-e).n)˛) / "v-e"^4.
|
||||
// Hoppe97 formula: k^2= a^2 * ("v-e"^2 - ((v-e).n)^2) / "v-e"^4.
|
||||
//-----------------
|
||||
// Can't do it because geomorph is made on Graphic card, so the simplier is the better.
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ void CQuatPack::pack(const CQuat &quat)
|
|||
/*
|
||||
This is the most precise/faster compression we can have. Some other tries have been made.
|
||||
|
||||
- deducing w from x,y,z is possible with w= 1-sqrt(x˛+y˛+z˛) (with tradeoff of the W sign)
|
||||
- deducing w from x,y,z is possible with w= 1-sqrt(x^2+y^2+z^2) (with tradeoff of the W sign)
|
||||
but very not precise.
|
||||
- Transform the quaternion to an AxisAngle is possible, but slower (some cos/sin or LUT).
|
||||
Axis is encoded with sint16, and angle is encoded with uint16.
|
||||
|
|
|
@ -52,7 +52,7 @@ static const char *WaterVPNoWave =
|
|||
MUL R3, v[0], c[7]; #compute bump 1 uv's \n\
|
||||
ADD o[TEX1], R3, c[8]; \n\
|
||||
ADD R0, c[9], -v[0]; #r1 = eye - vertex \n\
|
||||
DP3 R1, R0, R0; #r1 = eye - vertex, r2 = (eye - vertex)² \n\
|
||||
DP3 R1, R0, R0; #r1 = eye - vertex, r2 = (eye - vertex)^2 \n\
|
||||
RSQ R1, R1.x; #r1 = eye - vertex, r2 = 1/d(eye, vertex) \n\
|
||||
MUL R0, R0, R1; \n\
|
||||
DP3 R1.x, R0.xyww, R0.xyww; \n\
|
||||
|
@ -73,7 +73,7 @@ ADD o[TEX0], R3, c[6]; \n\
|
|||
MUL R3, v[0], c[7]; #compute bump 1 uv's \n\
|
||||
ADD o[TEX1], R3, c[8]; \n\
|
||||
ADD R0, c[9], -v[0]; #r1 = eye - vertex \n\
|
||||
DP3 R1, R0, R0; #r1 = eye - vertex, r2 = (eye - vertex)² \n\
|
||||
DP3 R1, R0, R0; #r1 = eye - vertex, r2 = (eye - vertex)^2 \n\
|
||||
RSQ R1, R1.x; #r1 = eye - vertex, r2 = 1/d(eye, vertex) \n\
|
||||
MUL R0, R0, R1; \n\
|
||||
MAD o[TEX2], -R0, c[10], c[10]; #envmap tex coord \n\
|
||||
|
@ -103,7 +103,7 @@ END";
|
|||
static const char *WaterVPStartCode =
|
||||
"!!VP1.0\n\
|
||||
ADD R1, c[7], -v[0]; #r1 = eye - vertex \n\
|
||||
DP3 R2, R1, R1; #r1 = eye - vertex, r2 = (eye - vertex)² \n\
|
||||
DP3 R2, R1, R1; #r1 = eye - vertex, r2 = (eye - vertex)^2 \n\
|
||||
MAX R2, R2, c[16]; # avoid imprecision around 0 \n\
|
||||
RSQ R2, R2.x; #r1 = eye - vertex, r2 = 1/d(eye, vertex) \n\
|
||||
RCP R3, R2.x; \n\
|
||||
|
|
|
@ -185,7 +185,7 @@ CRational64 CEdgeCollide::testPointMove(const CVector2f &start, const CVector2f
|
|||
// ***************************************************************************
|
||||
static inline float testCirclePoint(const CVector2f &start, const CVector2f &delta, float radius, const CVector2f &point)
|
||||
{
|
||||
// factors of the qaudratic: at² + bt + c=0
|
||||
// factors of the qaudratic: at^2 + bt + c=0
|
||||
float a,b,c;
|
||||
float dta;
|
||||
float r0, r1, res;
|
||||
|
@ -212,7 +212,7 @@ static inline float testCirclePoint(const CVector2f &start, const CVector2f &de
|
|||
b= 2* (relC.x*relV.x + relC.y*relV.y);
|
||||
c= relC.x*relC.x + relC.y*relC.y - radius*radius;
|
||||
// compute delta of the quadratic.
|
||||
dta= b*b - 4*a*c; // b²-4ac
|
||||
dta= b*b - 4*a*c; // b^2-4ac
|
||||
if(dta>=0)
|
||||
{
|
||||
dta= (float)sqrt(dta);
|
||||
|
@ -389,7 +389,7 @@ bool CEdgeCollide::testEdgeMove(const CVector2f &q0, const CVector2f &q1, const
|
|||
// compute D1 line equation of q0q1. bx - ay + c(t)=0, where c is function of time [0,1].
|
||||
// ===========================
|
||||
tmp= q1 - q0; // NB: along time, the direction doesn't change.
|
||||
// Divide by norm()², so that a projection on this edge is true if the proj is in interval [0,1].
|
||||
// Divide by norm()^2, so that a projection on this edge is true if the proj is in interval [0,1].
|
||||
tmp/= tmp.sqrnorm();
|
||||
a= tmp.x;
|
||||
b= tmp.y;
|
||||
|
@ -401,7 +401,7 @@ bool CEdgeCollide::testEdgeMove(const CVector2f &q0, const CVector2f &q1, const
|
|||
// compute D2 line equation of P0P1. ex - dy + f=0.
|
||||
// ===========================
|
||||
tmp= P1 - P0;
|
||||
// Divide by norm()², so that a projection on this edge is true if the proj is in interval [0,1].
|
||||
// Divide by norm()^2, so that a projection on this edge is true if the proj is in interval [0,1].
|
||||
tmp/= tmp.sqrnorm();
|
||||
d= tmp.x;
|
||||
e= tmp.y;
|
||||
|
|
|
@ -1525,7 +1525,7 @@ void NLPACS::CGlobalRetriever::testCollisionWithCollisionChains(CCollisionSurfac
|
|||
nlassert(collidedSurface.RetrieverInstanceId < (sint)_Instances.size());
|
||||
|
||||
// insert or replace this collision in collisionDescs.
|
||||
// NB: yes this looks like a N algorithm (so N²). But not so many collisions may arise, so don't bother.
|
||||
// NB: yes this looks like a N algorithm (so N^2). But not so many collisions may arise, so don't bother.
|
||||
sint indexInsert= cst.CollisionDescs.size();
|
||||
sint colFound= -1;
|
||||
|
||||
|
|
|
@ -576,19 +576,19 @@ bool CPrimitiveWorldImage::evalCollisionPoverOC (CPrimitiveWorldImage& other, CC
|
|||
* p'(t) = p'0 + v'0*(t - t'0)
|
||||
*
|
||||
* Find t for this equation:
|
||||
* R² = Norm² (p(t) - p'(t))
|
||||
* R² = Norm² ( p0 + v0 ( t - t0 ) - p'0 - v'0 ( t - t'0 ) )
|
||||
* R^2 = Norm^2 (p(t) - p'(t))
|
||||
* R^2 = Norm^2 ( p0 + v0 ( t - t0 ) - p'0 - v'0 ( t - t'0 ) )
|
||||
*
|
||||
* A = p0 - v0*t0 - p'0 + v'0*t'0
|
||||
* B = (v0 - v'0)
|
||||
*
|
||||
* Norm² (B)*t² + 2*(A.B)*t + Norm² (A) - R² = 0
|
||||
* Norm^2 (B)*t^2 + 2*(A.B)*t + Norm^2 (A) - R^2 = 0
|
||||
*
|
||||
* a = Norm² (B)
|
||||
* a = Norm^2 (B)
|
||||
* b = 2*(A.B)
|
||||
* c = Norm² (A) - R²
|
||||
* c = Norm^2 (A) - R^2
|
||||
*
|
||||
* a*t² + b*t + c = 0
|
||||
* a*t^2 + b*t + c = 0
|
||||
*/
|
||||
|
||||
// Let's go
|
||||
|
@ -784,19 +784,19 @@ bool CPrimitiveWorldImage::evalCollisionOCoverOC (CPrimitiveWorldImage& other, C
|
|||
* p'(t) = p'0 + v'0*(t - t'0)
|
||||
*
|
||||
* Find t for this equation:
|
||||
* (R + R')² = Norm² (p(t) - p'(t))
|
||||
* (R + R')² = Norm² ( p0 + v0 ( t - t0 ) - p'0 - v'0 ( t - t'0 ) )
|
||||
* (R + R')^2 = Norm^2 (p(t) - p'(t))
|
||||
* (R + R')^2 = Norm^2 ( p0 + v0 ( t - t0 ) - p'0 - v'0 ( t - t'0 ) )
|
||||
*
|
||||
* A = p0 - v0*t0 - p'0 + v'0*t'0
|
||||
* B = (v0 - v'0)
|
||||
*
|
||||
* Norm² (B)*t² + 2*(A.B)*t + Norm² (A) - (R + R')² = 0
|
||||
* Norm^2 (B)*t^2 + 2*(A.B)*t + Norm^2 (A) - (R + R')^2 = 0
|
||||
*
|
||||
* a = Norm² (B)
|
||||
* a = Norm^2 (B)
|
||||
* b = 2*(A.B)
|
||||
* c = Norm² (A) - (R + R')²
|
||||
* c = Norm^2 (A) - (R + R')^2
|
||||
*
|
||||
* a*t² + b*t + c = 0
|
||||
* a*t^2 + b*t + c = 0
|
||||
*/
|
||||
|
||||
// Let's go
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
|
||||
uint32 size;
|
||||
message.serial(size);
|
||||
// The following test removed by Sadge because it appears to be pointless and prevents ² testing to continue as required
|
||||
// The following test removed by Sadge because it appears to be pointless and prevents ^2 testing to continue as required
|
||||
// if ( size > 512 )
|
||||
// {
|
||||
// throw NLMISC::EInvalidDataStream();
|
||||
|
|
Loading…
Reference in a new issue