Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Clark Lin
hw3d
Commits
e8a59d8c
Commit
e8a59d8c
authored
Jun 26, 2019
by
chili
Browse files
applied transform before node transform
parent
e7e22eda
Changes
2
Hide whitespace changes
Inline
Side-by-side
hw3d/Mesh.cpp
View file @
e8a59d8c
...
@@ -66,20 +66,20 @@ DirectX::XMMATRIX Mesh::GetTransformXM() const noexcept
...
@@ -66,20 +66,20 @@ DirectX::XMMATRIX Mesh::GetTransformXM() const noexcept
// Node
// Node
Node
::
Node
(
const
std
::
string
&
name
,
std
::
vector
<
Mesh
*>
meshPtrs
,
const
DirectX
::
XMMATRIX
&
transform
)
noxnd
Node
::
Node
(
const
std
::
string
&
name
,
std
::
vector
<
Mesh
*>
meshPtrs
,
const
DirectX
::
XMMATRIX
&
transform
_in
)
noxnd
:
:
meshPtrs
(
std
::
move
(
meshPtrs
)
),
meshPtrs
(
std
::
move
(
meshPtrs
)
),
name
(
name
)
name
(
name
)
{
{
dx
::
XMStoreFloat4x4
(
&
baseT
ransform
,
transform
);
dx
::
XMStoreFloat4x4
(
&
t
ransform
,
transform
_in
);
dx
::
XMStoreFloat4x4
(
&
appliedTransform
,
dx
::
XMMatrixIdentity
()
);
dx
::
XMStoreFloat4x4
(
&
appliedTransform
,
dx
::
XMMatrixIdentity
()
);
}
}
void
Node
::
Draw
(
Graphics
&
gfx
,
DirectX
::
FXMMATRIX
accumulatedTransform
)
const
noxnd
void
Node
::
Draw
(
Graphics
&
gfx
,
DirectX
::
FXMMATRIX
accumulatedTransform
)
const
noxnd
{
{
const
auto
built
=
const
auto
built
=
dx
::
XMLoadFloat4x4
(
&
base
Transform
)
*
dx
::
XMLoadFloat4x4
(
&
applied
Transform
)
*
dx
::
XMLoadFloat4x4
(
&
appliedT
ransform
)
*
dx
::
XMLoadFloat4x4
(
&
t
ransform
)
*
accumulatedTransform
;
accumulatedTransform
;
for
(
const
auto
pm
:
meshPtrs
)
for
(
const
auto
pm
:
meshPtrs
)
{
{
...
...
hw3d/Mesh.h
View file @
e8a59d8c
...
@@ -45,7 +45,7 @@ private:
...
@@ -45,7 +45,7 @@ private:
std
::
string
name
;
std
::
string
name
;
std
::
vector
<
std
::
unique_ptr
<
Node
>>
childPtrs
;
std
::
vector
<
std
::
unique_ptr
<
Node
>>
childPtrs
;
std
::
vector
<
Mesh
*>
meshPtrs
;
std
::
vector
<
Mesh
*>
meshPtrs
;
DirectX
::
XMFLOAT4X4
baseT
ransform
;
DirectX
::
XMFLOAT4X4
t
ransform
;
DirectX
::
XMFLOAT4X4
appliedTransform
;
DirectX
::
XMFLOAT4X4
appliedTransform
;
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment