Cutscene viewer rendering peds

This commit is contained in:
dexy
2019-11-26 01:26:28 +11:00
Unverified
parent 319214fd7c
commit 6467797c3d
8 changed files with 264 additions and 96 deletions
+5
View File
@@ -427,6 +427,11 @@ namespace CodeWalker.Rendering
public void UpdateAnims(double realTime)
{
if (ClipMapEntry?.OverridePlayTime ?? false)
{
realTime = ClipMapEntry.PlayTime;
}
if (CurrentAnimTime == realTime) return;//already updated this!
CurrentAnimTime = realTime;
+13 -4
View File
@@ -2496,7 +2496,7 @@ namespace CodeWalker.Rendering
return res;
}
public bool RenderDrawable(DrawableBase drawable, Archetype arche, YmapEntityDef entity, uint txdHash = 0, TextureDictionary txdExtra = null, Texture diffOverride = null, ClipMapEntry animClip = null)
public bool RenderDrawable(DrawableBase drawable, Archetype arche, YmapEntityDef entity, uint txdHash = 0, TextureDictionary txdExtra = null, Texture diffOverride = null, ClipMapEntry animClip = null, Ped ped = null)
{
//enqueue a single drawable for rendering.
@@ -2521,10 +2521,10 @@ namespace CodeWalker.Rendering
rndbl.ResetBoneTransforms();
}
return RenderRenderable(rndbl, arche, entity);
return RenderRenderable(rndbl, arche, entity, ped);
}
private bool RenderRenderable(Renderable rndbl, Archetype arche, YmapEntityDef entity)
private bool RenderRenderable(Renderable rndbl, Archetype arche, YmapEntityDef entity, Ped ped = null)
{
//enqueue a single renderable for rendering.
@@ -2564,6 +2564,15 @@ namespace CodeWalker.Rendering
camrel += position;
distance = entity.Distance;
}
else if (ped != null)
{
position = ped.Position;
orientation = ped.Rotation;
bbmin += position;
bbmax += position;
camrel += position;
distance = (camrel + bscen).Length();
}
else
{
distance = (camrel + bscen).Length();
@@ -2799,7 +2808,7 @@ namespace CodeWalker.Rendering
if (drawFlag)
{
RenderDrawable(drawable, null, null, 0, td, texture, ac);
RenderDrawable(drawable, null, null, 0, td, texture, ac, ped);
}