demo player movement

This commit is contained in:
h4570
2022-07-31 17:37:48 +02:00
parent 12dd72f15e
commit b94ef8c416
12 changed files with 134 additions and 15 deletions
@@ -63,7 +63,11 @@ void DynPipCore::initParts(DynPipBag* bag) {
texBuffers = new RendererCoreTextureBuffers{temp.id, temp.core, temp.clut};
}
mvp = rendererCore->renderer3D.getViewProj() * *bag->info->model;
if (bag->info->transformationType == TyraMP) {
mvp = rendererCore->renderer3D.getProjection() * *bag->info->model;
} else {
mvp = rendererCore->renderer3D.getViewProj() * *bag->info->model;
}
qbufferRenderer.sendObjectData(bag, &mvp, texBuffers);
@@ -212,11 +212,13 @@ PipelineInfoBag* DynamicPipeline::getInfoBag(DynamicMesh* mesh,
result->blendingEnabled = options->blendingEnabled;
result->shadingType = options->shadingType;
result->textureMappingType = options->textureMappingType;
result->transformationType = options->transformationType;
} else {
result->antiAliasingEnabled = false;
result->blendingEnabled = true;
result->shadingType = TyraShadingFlat;
result->textureMappingType = TyraLinear;
result->transformationType = TyraMVP;
}
result->model = model;
@@ -14,6 +14,7 @@ namespace Tyra {
PipelineInfoBag::PipelineInfoBag() {
shadingType = TyraShadingFlat;
transformationType = TyraMVP;
textureMappingType = TyraLinear;
blendingEnabled = true;
antiAliasingEnabled = false;
@@ -96,6 +96,10 @@ void StaPipCore::render(StaPipBag* bag, const bool& frustumCull,
TYRA_ASSERT(
!bag->texture || (bag->texture->texture && bag->texture->coordinates),
"If you want texture, please provide texture and coordinates!");
TYRA_ASSERT(bag->info->transformationType == TyraMVP ||
(!bag->info->fullClipChecks && !frustumCull),
"Please disable clip checks and frustum culling if not using MVP "
"matrix!");
TYRA_ASSERT(!(frustumCull == false && bag->info->fullClipChecks == true),
"Full clip checks are not supported with frustum culling = off!");
@@ -126,7 +130,13 @@ void StaPipCore::render(StaPipBag* bag, const bool& frustumCull,
packager.setRenderBBox(renderBbox);
auto mvp = rendererCore->renderer3D.getViewProj() * *bag->info->model;
M4x4 mvp;
if (bag->info->transformationType == TyraMP) {
mvp = rendererCore->renderer3D.getProjection() * *bag->info->model;
} else {
mvp = rendererCore->renderer3D.getViewProj() * *bag->info->model;
}
RendererCoreTextureBuffers* texBuffers = nullptr;
if (bag->texture) {
@@ -47,6 +47,11 @@ void StaticPipeline::render(StaticMesh* mesh, const StaPipOptions* options) {
!(frustumCulling != PipelineFrustumCulling_Precise &&
infoBag->fullClipChecks == true),
"Full clip checks are only supported with frustum culling == Precise!");
TYRA_ASSERT(options->transformationType == TyraMVP ||
(!options->fullClipChecks &&
options->frustumCulling == PipelineFrustumCulling_None),
"Please disable clip checks and frustum culling if not using MVP "
"matrix!");
if (frustumCulling == PipelineFrustumCulling_Simple) {
auto* frame = mesh->getFrame();
@@ -95,12 +100,14 @@ PipelineInfoBag* StaticPipeline::getInfoBag(StaticMesh* mesh,
result->shadingType = options->shadingType;
result->fullClipChecks = options->fullClipChecks;
result->textureMappingType = options->textureMappingType;
result->transformationType = options->transformationType;
} else {
result->antiAliasingEnabled = false;
result->blendingEnabled = true;
result->shadingType = TyraShadingFlat;
result->textureMappingType = TyraLinear;
result->fullClipChecks = false;
result->transformationType = TyraMVP;
}
result->model = model;