mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-17 06:14:47 +08:00
Cutscene viewer rendering peds
This commit is contained in:
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user