Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sip
common
Compare revisions
12d9761b71f6fc2c58844abcbaf3a002c1397050 to cc34760a0f9dc08eaa9db29930f96c9697a7e975
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
sip/common
Select target project
No results found
cc34760a0f9dc08eaa9db29930f96c9697a7e975
Select Git revision
Loading items
Swap
Target
sip/common
Select target project
sip/common
1 result
12d9761b71f6fc2c58844abcbaf3a002c1397050
Select Git revision
Loading items
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source
1
Fixed some warnings
· cc34760a
D-AIRY
authored
Mar 30, 2020
cc34760a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
math.h
+17
-17
17 additions, 17 deletions
math.h
with
17 additions
and
17 deletions
math.h
View file @
cc34760a
...
...
@@ -819,7 +819,7 @@ __forceinline float SMVector3Dot(const float3 & V1)
__forceinline
float3
SMVector3Cross
(
const
float3
&
V1
,
const
float3
&
V2
)
{
static
const
SMVECTORI32
mask
=
{
0xFFFFFFFF
,
0xFFFFFFFF
,
0xFFFFFFFF
,
0x00000000
};
static
const
SMVECTORI32
mask
=
{
(
int
)
0xFFFFFFFF
,
(
int
)
0xFFFFFFFF
,
(
int
)
0xFFFFFFFF
,
0x00000000
};
SMVECTOR
vTemp1
;
vTemp1
.
mmv
=
_mm_shuffle_ps
(
V1
,
V1
,
_MM_SHUFFLE
(
3
,
0
,
2
,
1
));
...
...
@@ -1379,7 +1379,7 @@ __forceinline SMMATRIX SMMatrixRotationNormal(const float3 & NormalAxis, float A
SMVECTOR
V0
,
V1
,
V2
;
SMVECTOR
R0
,
R1
,
R2
;
SMVECTOR
C0
,
C1
,
C2
;
static
const
SMVECTORI32
mask
=
{
0xFFFFFFFF
,
0xFFFFFFFF
,
0xFFFFFFFF
,
0x00000000
};
static
const
SMVECTORI32
mask
=
{
(
int
)
0xFFFFFFFF
,
(
int
)
0xFFFFFFFF
,
(
int
)
0xFFFFFFFF
,
0x00000000
};
SMMATRIX
M
;
float
fSinAngle
=
sinf
(
Angle
);
...
...
@@ -1429,8 +1429,8 @@ __forceinline SMMATRIX SMMatrixRotationAxis(const float3 & Axis, float Angle)
__forceinline
SMMATRIX
SMMatrixLookToLH
(
const
float3
&
EyePosition
,
const
float3
&
EyeDirection
,
const
float3
&
UpDirection
)
{
static
const
SMVECTORI32
mask3
=
{
0xFFFFFFFF
,
0xFFFFFFFF
,
0xFFFFFFFF
,
0x00000000
};
static
const
SMVECTORI32
maskW
=
{
0x00000000
,
0x00000000
,
0x00000000
,
0xFFFFFFFF
};
static
const
SMVECTORI32
mask3
=
{
(
int
)
0xFFFFFFFF
,
(
int
)
0xFFFFFFFF
,
(
int
)
0xFFFFFFFF
,
0x00000000
};
static
const
SMVECTORI32
maskW
=
{
0x00000000
,
0x00000000
,
0x00000000
,
(
int
)
0xFFFFFFFF
};
SMMATRIX
M
;
SMVECTOR
R2
=
SMVector3Normalize
(
EyeDirection
);
SMVECTOR
R0
=
SMVector3Cross
(
UpDirection
,
R2
);
...
...
@@ -1464,7 +1464,7 @@ __forceinline SMMATRIX SMMatrixLookAtLH(const float3 & EyePosition, const float3
__forceinline
SMMATRIX
SMMatrixPerspectiveLH
(
float
ViewWidth
,
float
ViewHeight
,
float
NearZ
,
float
FarZ
)
{
SMVECTORI32
maskY
=
{
0x00000000
,
0xFFFFFFFF
,
0x00000000
,
0x00000000
};
SMVECTORI32
maskY
=
{
0x00000000
,
(
int
)
0xFFFFFFFF
,
0x00000000
,
0x00000000
};
SMMATRIX
M
;
float
TwoNearZ
=
NearZ
+
NearZ
;
float
fRange
=
FarZ
/
(
FarZ
-
NearZ
);
...
...
@@ -1501,7 +1501,7 @@ __forceinline SMMATRIX SMMatrixPerspectiveLH(float ViewWidth, float ViewHeight,
__forceinline
SMMATRIX
SMMatrixPerspectiveFovLH
(
float
FovAngleY
,
float
AspectRatio
,
float
NearZ
,
float
FarZ
)
{
SMVECTORI32
maskY
=
{
0x00000000
,
0xFFFFFFFF
,
0x00000000
,
0x00000000
};
SMVECTORI32
maskY
=
{
0x00000000
,
(
int
)
0xFFFFFFFF
,
0x00000000
,
0x00000000
};
SMMATRIX
M
;
float
SinFov
=
sinf
(
0.5f
*
FovAngleY
);
float
CosFov
=
cosf
(
0.5f
*
FovAngleY
);
...
...
@@ -1540,7 +1540,7 @@ __forceinline SMMATRIX SMMatrixPerspectiveFovLH(float FovAngleY, float AspectRat
__forceinline
SMMATRIX
SMMatrixOrthographicLH
(
float
ViewWidth
,
float
ViewHeight
,
float
NearZ
,
float
FarZ
)
{
SMVECTORI32
maskY
=
{
0x00000000
,
0xFFFFFFFF
,
0x00000000
,
0x00000000
};
SMVECTORI32
maskY
=
{
0x00000000
,
(
int
)
0xFFFFFFFF
,
0x00000000
,
0x00000000
};
SMMATRIX
M
;
float
fRange
=
1.0f
/
(
FarZ
-
NearZ
);
...
...
@@ -1910,8 +1910,8 @@ public:
SMQuaternion
::
SMQuaternion
(
float
angle
,
char
ax
)
{
float
sin_a
=
sin
(
angle
/
2
);
float
cos_a
=
cos
(
angle
/
2
);
float
sin_a
=
sin
f
(
angle
/
2
.0f
);
float
cos_a
=
cos
f
(
angle
/
2
.0f
);
x
=
y
=
z
=
w
=
0.0f
;
switch
(
ax
)
{
...
...
@@ -2003,7 +2003,7 @@ public:
if
(
tr
>
0.0
)
{
s
=
sqrt
(
tr
+
1.0f
);
s
=
sqrt
f
(
tr
+
1.0f
);
w
=
s
/
2.0f
;
s
=
0.5f
/
s
;
x
=
(
m
[
1
][
2
]
-
m
[
2
][
1
])
*
s
;
...
...
@@ -2018,7 +2018,7 @@ public:
j
=
nxt
[
i
];
k
=
nxt
[
j
];
s
=
sqrt
((
m
[
i
][
i
]
-
(
m
[
j
][
j
]
+
m
[
k
][
k
]))
+
1.0f
);
s
=
sqrt
f
((
m
[
i
][
i
]
-
(
m
[
j
][
j
]
+
m
[
k
][
k
]))
+
1.0f
);
q
[
i
]
=
s
*
0.5f
;
...
...
@@ -2102,7 +2102,7 @@ __forceinline SMQuaternion SMQuaternion::Normalize()
__forceinline
float
SMQuaternion
::
Length
()
{
return
(
sqrt
(
x
*
x
+
y
*
y
+
z
*
z
+
w
*
w
));
return
(
sqrt
f
(
x
*
x
+
y
*
y
+
z
*
z
+
w
*
w
));
}
__forceinline
SMQuaternion
SMQuaternion
::
Inverse
()
...
...
@@ -2302,8 +2302,8 @@ __forceinline float3 SMMatrixToEuler(const SMMATRIX & mat)
float
RADIANS
=
180.0f
/
SM_PI
;
float
D
;
float3
res
;
res
.
y
=
D
=
-
asin
(
mat
.
_13
);
float
C
=
cos
(
res
.
y
);
res
.
y
=
D
=
-
asin
f
(
mat
.
_13
);
float
C
=
cos
f
(
res
.
y
);
//res.y *= RADIANS;
float
tr_x
,
tr_y
;
...
...
@@ -2312,12 +2312,12 @@ __forceinline float3 SMMatrixToEuler(const SMMATRIX & mat)
tr_x
=
mat
.
_33
/
C
;
tr_y
=
-
mat
.
_23
/
C
;
res
.
x
=
atan2
(
tr_y
,
tr_x
)
/* * RADIANS*/
;
res
.
x
=
atan2
f
(
tr_y
,
tr_x
)
/* * RADIANS*/
;
tr_x
=
mat
.
_11
/
C
;
tr_y
=
-
mat
.
_12
/
C
;
res
.
z
=
atan2
(
tr_y
,
tr_x
)
/* * RADIANS*/
;
res
.
z
=
atan2
f
(
tr_y
,
tr_x
)
/* * RADIANS*/
;
}
else
{
...
...
@@ -2326,7 +2326,7 @@ __forceinline float3 SMMatrixToEuler(const SMMATRIX & mat)
tr_x
=
mat
.
_22
;
tr_y
=
mat
.
_21
;
res
.
z
=
atan2
(
tr_y
,
tr_x
)
/* * RADIANS*/
;
res
.
z
=
atan2
f
(
tr_y
,
tr_x
)
/* * RADIANS*/
;
}
//D3DXToRadian
//res.x = -SMToRadian(res.x);
...
...
This diff is collapsed.
Click to expand it.