Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Graphics/Scene/BgObject.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using FFXIVClientStructs.FFXIV.Client.System.Resource;
using FFXIVClientStructs.FFXIV.Client.System.Resource.Handle;
using FFXIVClientStructs.FFXIV.Common.Math;

Expand All @@ -15,6 +16,37 @@ public unsafe partial struct BgObject {
[FieldOffset(0xA0)] internal Matrix4x4* CachedTransformMatrices;
[FieldOffset(0xA8)] public BgObjectStainBuffer* StainBuffer;
[FieldOffset(0xB0)] internal Transform* CachedTransform;
[FieldOffset(0xB8)] public BgObjectAnimationData* LoadedAnimationData; // Not null even if no skeleton or animation were found

/// <summary>
/// Loads the skeleton and animation for this BgObject, if any.
/// </summary>
/// <remarks>
/// The skeleton and animation resources are found by changing the extension of the given model resource path
/// to <c>.sklb</c> and <c>.pap</c>, respectively, and are loaded async.
/// </remarks>
/// <param name="modelResourcePath">The path of the model resource.</param>
/// <returns>Whether a skeleton and animation were found.</returns>
[GenerateStringOverloads]
[MemberFunction("E8 ?? ?? ?? ?? 0F B6 8B ?? ?? ?? ?? 84 C0 74 21")]
public partial bool LoadAnimationData(CStringPointer modelResourcePath);

/// <summary>
/// Resets the <see cref="BgObject.Flags"/>, <see cref="BgObject.OutlineFlags"/>, and <see cref="BgObject.ObjectFlags"/>
/// for this BgObject during its creation.
/// </summary>
[MemberFunction("E8 ?? ?? ?? ?? 48 8B 0D ?? ?? ?? ?? 48 8B D3 E8 ?? ?? ?? ?? 48 8B CB E8 ?? ?? ?? ?? 48 8D 4C 24 ??")]
public partial void ResetFlags();

/// <summary>
/// Loads the model resource at the given path.
/// </summary>
/// <param name="modelResourceCategory">The resource category that contains the model resource.</param>
/// <param name="modelResourcePath">The path of the model resource.</param>
/// <returns>Success or failure.</returns>
[MemberFunction("48 89 5C 24 ?? 57 48 83 EC 30 48 8B C2 C7 44 24 ?? ?? ?? ?? ??")]
[GenerateStringOverloads]
public partial bool SetModel(ResourceCategory* modelResourceCategory, CStringPointer modelResourcePath);

[GenerateStringOverloads]
[MemberFunction("E8 ?? ?? ?? ?? 48 89 43 30 48 8B D7")]
Expand Down Expand Up @@ -54,3 +86,10 @@ public struct BgObjectStainBuffer {
/// </remarks>
[FieldOffset(0x04)] public Vector4 LinearFloatColor;
}

[StructLayout(LayoutKind.Explicit, Size = 0x120)]
public unsafe struct BgObjectAnimationData {
[FieldOffset(0x00)] public CharacterBase.SkeletonAnimationContainer SkeletonAnimationContainer;
[FieldOffset(0x100)] public SkeletonResourceHandle* AsyncSkeletonResourceHandle;
[FieldOffset(0x108)] public ResourceHandle* AsyncPapResourceHandle;
}
3 changes: 3 additions & 0 deletions ida/data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7410,6 +7410,9 @@ classes:
funcs:
0x14043DB80: ctor
0x1407743A0: Create
0x140440160: LoadAnimationData
0x14043DC20: ResetFlags
0x14043E040: SetModel
Client::Graphics::Scene::EnvScene:
vtbls:
- ea: 0x142098ED8
Expand Down
Loading