Skip to content

Commit

Permalink
Merge pull request #14 from LordRadai/v1.3.2
Browse files Browse the repository at this point in the history
V1.3.2
  • Loading branch information
LordRadai authored Dec 11, 2024
2 parents 35c724e + 0ee6ca9 commit f24348f
Show file tree
Hide file tree
Showing 35 changed files with 46,860 additions and 1,014 deletions.
2 changes: 1 addition & 1 deletion DS2AnimToolset/Morpheme4
4 changes: 2 additions & 2 deletions DS2AnimToolset/morphemeEditor/AnimObject/AnimObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ Matrix AnimObject::getTransformAtTime(float time, int channelId)
NMP::Quat trajRot;
animHandle->getTrajectory(trajRot, trajPos);

return utils::NMDX::getWorldMatrix(trajRot, trajPos);
return utils::NMDX::getTransformMatrix(trajRot, trajPos);
}

return utils::NMDX::getWorldMatrix(animHandle->getChannelData()[channelId].m_quat, animHandle->getChannelData()[channelId].m_pos);
return utils::NMDX::getTransformMatrix(animHandle->getChannelData()[channelId].m_quat, animHandle->getChannelData()[channelId].m_pos);
}

Vector3 AnimObject::getTransformPosAtTime(float time, int channelId)
Expand Down
10 changes: 0 additions & 10 deletions DS2AnimToolset/morphemeEditor/Application/Application.cpp

This file was deleted.

4 changes: 2 additions & 2 deletions DS2AnimToolset/morphemeEditor/Application/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Application
{
public:
~Application();
~Application() {}

bool isInitialised() const { return this->m_initialised; }

Expand All @@ -12,7 +12,7 @@ class Application
virtual void shutdown() = 0;

protected:
Application();
Application() {}

bool m_initialised = false;
};
28 changes: 26 additions & 2 deletions DS2AnimToolset/morphemeEditor/Character/Character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
#include "extern.h"
#include "utils/utils.h"
#include "MorphemeEditorApp/MorphemeEditorApp.h"
#include "DebugDraw/DebugDraw.h"
#include "RenderManager/RenderManager.h"
#include <PrimitiveBatch.h>
#include <VertexTypes.h>

namespace
{
Expand Down Expand Up @@ -70,6 +74,26 @@ namespace
model->draw(renderManager);
}

void drawCharacterController(Character* character, RenderManager* renderManager)
{
Matrix world = Matrix::Identity;

renderManager->applyDebugEffect(world);
renderManager->setInputLayout(kDebugLayout);

MR::CharacterControllerDef* ccDef = character->getMorphemeNetwork()->getActiveCharacterControllerDef();
DirectX::PrimitiveBatch<DirectX::VertexPositionColor> prim(renderManager->getDeviceContext());
prim.Begin();

const Vector3 vertexA = Vector3(0, ccDef->getRadius(), 0);
const Vector3 vertexB = vertexA + Vector3(0, ccDef->getHeight() - ccDef->getRadius(), 0);
const NMP::Colour color = ccDef->getColour();

DX::DrawCapsule(&prim, Matrix::CreateScale(character->getCharacterModelCtrl()->getScale()) * Matrix::CreateTranslation(character->getPosition()), vertexA, vertexB, ccDef->getRadius(), RMath::getFloatColor(color.getR(), color.getG(), color.getB(), color.getA()), true);

prim.End();
}

void writeArgumentValue(const TimeAct::Argument* arg, TimeAct::TaeExport::TimeActArgumentExportXML* argExport)
{
switch (arg->getType())
Expand Down Expand Up @@ -403,8 +427,6 @@ Character* Character::createFromNmb(std::vector<std::wstring>& fileList, const c
if (!character->m_morphemeCharacter)
throw("Failed to create MorphemeCharacter instance (%s)", filename);

characterDef->loadAnimations();

std::wstring animFolder = std::filesystem::path(filename).parent_path().c_str();
const int animCount = characterDef->getAnimFileLookUp()->getNumAnims();

Expand Down Expand Up @@ -517,6 +539,8 @@ void Character::draw(RenderManager* renderManager)
drawFlverModel(this->m_characterModelCtrl->getModelFg(kFgEyes), renderManager);
drawFlverModel(this->m_characterModelCtrl->getModelFg(kFgFace), renderManager);
drawFlverModel(this->m_characterModelCtrl->getModelFg(kFgHair), renderManager);

//drawCharacterController(this, renderManager);
}

void Character::destroy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ void CharacterModelCtrl::destroy()

void CharacterModelCtrl::setModel(FlverModel* model)
{
if (model)
model->initModelData();

if (this->m_model)
this->m_model->destroy();

Expand Down
Loading

0 comments on commit f24348f

Please sign in to comment.