Twilight Princess
Remastered version of the GameCube game
Loading...
Searching...
No Matches
BMD Class Reference
+ Inheritance diagram for BMD:
+ Collaboration diagram for BMD:

Classes

struct  AnimationData
 
class  CustomAnimancerState
 
struct  CustomAnimationJob
 
class  EyeTexture
 
struct  MyAnimationJob
 
class  StoredMaterial
 

Public Member Functions

void Parse (string name, byte[] buffer, List< BTI > externalBTIs, bool isModel=false, bool useRigidbody=false)
 
void CreateShapes (GameObject targetObject=null)
 
BMD OverwriteMaterial (Material material)
 
BMD OverwriteMaterial (int sourceMaterialIndex, Material material)
 
BMD ChangeEmission (UnityEngine.Color color)
 
BMD ChangeAlphaThreshold (float alphaThreshold)
 
BMD ChangeColor (UnityEngine.Color color)
 
void CalculateWeights ()
 
void LoadAnimation (string bckName)
 
void LoadBTK (string btkName)
 
void LoadBRK (string brkName)
 
bool IsAnimationPlaying ()
 
ZeldaAnimation LoadSpecificAnimationOnMain (Archive archive, string bckName, LoopType loopType=LoopType.Loop, AnimationBehavior behavior=AnimationBehavior.Stay)
 
ZeldaAnimation LoadSpecificAnimation (Archive archive, string bckName, LoopType loopType=LoopType.Loop, AnimationBehavior behavior=AnimationBehavior.Stay)
 
async Task< AnimationSetup.AnimationCurveHolderLoadAnimationCurvesInBackground (Archive archive, string bckName, string startBone="##STOP##")
 
AnimationSetup.AnimationCurveHolder LoadAnimationCurves (Archive archive, string bckName, string startBone="##STOP##")
 
void PlaySequencedAnimation (params ZeldaAnimation[] states)
 
ZeldaAnimation MergeCurvesToAnimation (AnimationSetup.AnimationCurveHolder curve1, AnimationSetup.AnimationCurveHolder curve2, LoopType loopType=LoopType.Once, AnimationBehavior animationBehavior=AnimationBehavior.GoBack)
 
void PrepareWeights ()
 
void PrepareAnimation ()
 
Transform FindChildByPath (Transform root, string path)
 
BMD PlayAnimationFromDifferentArchive (string archive, string name)
 
BMD UseSameAnimationAsOriginalModelForCopy (BMD original)
 
void SetParticles (int groupID, int subId)
 
void PlayFacialBTP (string btpName, string external="")
 
void CreateMesh (GameObject child, SHP1.Shape shape, List< Vector3 > vertices, List< Vector3 > normals, BTI bti, BTI vertexBti, MeshVertexHolder vertexHolder, Material3 mat, bool external, bool externalVertex, bool isModel, int shapeIndex, Material overwriteMaterial=null)
 
void LoadTagDataFromFile (byte[] buffer, EndianBinaryReader reader, int tagCount, List< BTI > externalBTIs, bool isModel)
 
void ApplyBonePositionsToAnimationTransforms (IList< SkeletonJoint > boneList, Matrix4[] boneTransforms)
 
GameObject CreateSubMesh (GameObject target, string name)
 
GameObject GetWorldRoot ()
 
BMD SetParentJoint (BMD parent, string jointName)
 
BMD SetPosition (Vector3 translation)
 
void RemoveCollision ()
 
void ApplyFirstTranslation ()
 
BMD Translate (Vector3 translation)
 
BMD TranslateLocal (Vector3 translation)
 
BMD SetLocalPosition (Vector3 translation)
 
BMD SetLocalRotation (Vector3 translation)
 
BMD RotateXShort (int shortAngle)
 
void InitializeModelParams (ItemData data)
 
BMD RotateYShort (int shortAngle)
 
BMD RotateX (int angle)
 
BMD RotateY (int angle)
 
BMD ResetRotation ()
 
BMD SetRotation (Vector3 rotation)
 
BMD SetBaseScale (Vector3 scale)
 
BMD SetLocalScale (Vector3 scale)
 
void RotateByPivot (float target)
 
BMD ToUrpLitShader ()
 
void AddClothPhysics (float maxCoefficients)
 
void MoveToTarget (Transform target, float moveSpeed, float acceleration, float deceleration)
 
void InterruptMove ()
 

Static Public Member Functions

static BMD CopyModel (BMD originalBmd, GameObject parent)
 
static BMD CreateModelFromBuffer (Archive archive, string name, byte[] buffer, List< BTI > externalBTIs, GameObject o=null)
 
static BMD CreateModelFromPath (Archive archive, string name, List< BTI > externalBTIs, GameObject o=null)
 
static BMD CreateModelFromPathInPlace (Archive archive, string name, List< BTI > externalBTIs, Transform parent, bool UseRigidbody)
 
static void CreateStage (Archive archive, GameObject room, ArcFile file, string name, List< BTI > externalBTIs)
 

Public Attributes

INF1 INF1Tag
 
VTX1 VTX1Tag
 
EVP1 EVP1Tag
 
DRW1 DRW1Tag
 
JNT1 JNT1Tag
 
SHP1 SHP1Tag
 
MAT3 MAT3Tag
 
TEX1 TEX1Tag
 
string Magic
 
int Size
 
int Offset
 
int NumChunks
 
string Name
 
Actor Actor
 
Vector3 Dialogue3DRotation
 
int DialogueId
 
List< GameObjectChilds = new List<GameObject>()
 
List< TextureDataTextureDatas = new List<TextureData>()
 
Archive Archive
 
Dictionary< string, GameObjectjointGameObjects = new Dictionary<string, GameObject>()
 
BCK CurrentAnimation
 
BTK CurrentBTK
 
BRK CurrentBRK
 
bool IsLink
 
List< BCKPreloadedBCKs = new List<BCK>()
 
WeightDataGenerator WeightDataGenerator
 
List< TexMatrix[]> TexMatrixIndexes = new List<TexMatrix[]>()
 
int UpdateIndex
 
bool CheckCached = false
 
bool ForceCheck = false
 
Dictionary< int, Vector3[]> CachedAnimationsVerts = new Dictionary<int, Vector3[]>()
 
Dictionary< int, Vector3[]> CachedAnimationsNormals = new Dictionary<int, Vector3[]>()
 
bool CacheMeshes = false
 
Dictionary< string, AnimationClip > _animationClips = new Dictionary<string, AnimationClip>()
 
bool CompressedAnimations = false
 
Dictionary< string, AnimationSetup.AnimationCurveHolderspecificAnimations = new Dictionary<string, AnimationSetup.AnimationCurveHolder>()
 
bool LoadAnimationsOnMainThread = false
 
Animator _animator
 
AnimancerComponent _animancer
 
string lastAnimationName = ""
 
int MaxEyeTexture = 2
 
List< Renderer > _meshRenderers = new List<Renderer>()
 
Vector3 initTranslation = Vector3.zero
 

Private Member Functions

bool IsRendererVisible (Renderer renderer)
 
void FixedUpdate ()
 
void AddMeshColliderToSkinned ()
 
void PlayNextState (ZeldaAnimation[] states, int currentIndex)
 
IEnumerator BlinkRoutine ()
 
void OnDrawGizmos ()
 
Dictionary< string, GameObjectCreateJointGameObjects (List< SkeletonJoint > joints, Transform parent)
 
void BuildHierarchy (List< SkeletonJoint > joints, Dictionary< string, GameObject > jointGameObjects)
 
Transform FindJointGameObject (SkeletonJoint joint, Transform parentTransform)
 
void PrepareShape (GameObject target, int shapeIndex, List< BTI > externalBTIs, IList< SkeletonJoint > boneList, Matrix4[] boneTransforms, bool isModel)
 
float ShortToRadians (int shortValue)
 
IEnumerator _RotateByPivot (float target)
 
IEnumerator _MoveToTarget (Transform target, float maxMoveSpeed, float acceleration, float deceleration)
 
Transform RecursiveFindChild (Transform parent, string childName)
 

Private Attributes

TevColorOverride m_tevColorOverrides = new TevColorOverride()
 
List< BTIexternalBTIs
 
bool isModel
 
List< MeshFilter > meshFilters = new List<MeshFilter>()
 
List< MeshRenderer > meshRenderers = new List<MeshRenderer>()
 
List< MaterialmeshMaterials = new List<Material>()
 
int frameCounter = 0
 
int updateInterval = 30
 
int MaxUpdate
 
bool checkForExternalCache = true
 
string lastExternalArchiveForAnimation
 
BTP CurrentBTP
 
List< StoredMaterial_storedMaterials = new List<StoredMaterial>()
 
List< EyeTexture_eyeTextures = new List<EyeTexture>()
 
List< Vector3globalVerts = new List<Vector3>()
 
List< Vector3globalNormals = new List<Vector3>()
 
float currentSpeed
 
bool _forceStopMove = false
 

Member Function Documentation

◆ _MoveToTarget()

IEnumerator BMD._MoveToTarget ( Transform target,
float maxMoveSpeed,
float acceleration,
float deceleration )
private

◆ _RotateByPivot()

IEnumerator BMD._RotateByPivot ( float target)
private

◆ AddClothPhysics()

void BMD.AddClothPhysics ( float maxCoefficients)

◆ AddMeshColliderToSkinned()

void BMD.AddMeshColliderToSkinned ( )
private

◆ ApplyBonePositionsToAnimationTransforms()

void BMD.ApplyBonePositionsToAnimationTransforms ( IList< SkeletonJoint > boneList,
Matrix4[] boneTransforms )

◆ ApplyFirstTranslation()

void BMD.ApplyFirstTranslation ( )

◆ BlinkRoutine()

IEnumerator BMD.BlinkRoutine ( )
private

◆ BuildHierarchy()

void BMD.BuildHierarchy ( List< SkeletonJoint > joints,
Dictionary< string, GameObject > jointGameObjects )
private

◆ CalculateWeights()

void BMD.CalculateWeights ( )

◆ ChangeAlphaThreshold()

BMD BMD.ChangeAlphaThreshold ( float alphaThreshold)

◆ ChangeColor()

BMD BMD.ChangeColor ( UnityEngine.Color color)

◆ ChangeEmission()

BMD BMD.ChangeEmission ( UnityEngine.Color color)

◆ CopyModel()

static BMD BMD.CopyModel ( BMD originalBmd,
GameObject parent )
static

◆ CreateJointGameObjects()

Dictionary< string, GameObject > BMD.CreateJointGameObjects ( List< SkeletonJoint > joints,
Transform parent )
private

◆ CreateMesh()

void BMD.CreateMesh ( GameObject child,
SHP1.Shape shape,
List< Vector3 > vertices,
List< Vector3 > normals,
BTI bti,
BTI vertexBti,
MeshVertexHolder vertexHolder,
Material3 mat,
bool external,
bool externalVertex,
bool isModel,
int shapeIndex,
Material overwriteMaterial = null )

◆ CreateModelFromBuffer()

static BMD BMD.CreateModelFromBuffer ( Archive archive,
string name,
byte[] buffer,
List< BTI > externalBTIs,
GameObject o = null )
static

◆ CreateModelFromPath()

static BMD BMD.CreateModelFromPath ( Archive archive,
string name,
List< BTI > externalBTIs,
GameObject o = null )
static

◆ CreateModelFromPathInPlace()

static BMD BMD.CreateModelFromPathInPlace ( Archive archive,
string name,
List< BTI > externalBTIs,
Transform parent,
bool UseRigidbody )
static

◆ CreateShapes()

void BMD.CreateShapes ( GameObject targetObject = null)

◆ CreateStage()

static void BMD.CreateStage ( Archive archive,
GameObject room,
ArcFile file,
string name,
List< BTI > externalBTIs )
static

◆ CreateSubMesh()

GameObject BMD.CreateSubMesh ( GameObject target,
string name )

◆ FindChildByPath()

Transform BMD.FindChildByPath ( Transform root,
string path )

◆ FindJointGameObject()

Transform BMD.FindJointGameObject ( SkeletonJoint joint,
Transform parentTransform )
private

◆ FixedUpdate()

void BMD.FixedUpdate ( )
private

◆ GetWorldRoot()

GameObject BMD.GetWorldRoot ( )

◆ InitializeModelParams()

void BMD.InitializeModelParams ( ItemData data)

◆ InterruptMove()

void BMD.InterruptMove ( )

◆ IsAnimationPlaying()

bool BMD.IsAnimationPlaying ( )

◆ IsRendererVisible()

bool BMD.IsRendererVisible ( Renderer renderer)
private

◆ LoadAnimation()

void BMD.LoadAnimation ( string bckName)

◆ LoadAnimationCurves()

AnimationSetup.AnimationCurveHolder BMD.LoadAnimationCurves ( Archive archive,
string bckName,
string startBone = "##STOP##" )

◆ LoadAnimationCurvesInBackground()

async Task< AnimationSetup.AnimationCurveHolder > BMD.LoadAnimationCurvesInBackground ( Archive archive,
string bckName,
string startBone = "##STOP##" )

◆ LoadBRK()

void BMD.LoadBRK ( string brkName)

◆ LoadBTK()

void BMD.LoadBTK ( string btkName)

◆ LoadSpecificAnimation()

ZeldaAnimation BMD.LoadSpecificAnimation ( Archive archive,
string bckName,
LoopType loopType = LoopType::Loop,
AnimationBehavior behavior = AnimationBehavior::Stay )

◆ LoadSpecificAnimationOnMain()

ZeldaAnimation BMD.LoadSpecificAnimationOnMain ( Archive archive,
string bckName,
LoopType loopType = LoopType::Loop,
AnimationBehavior behavior = AnimationBehavior::Stay )

◆ LoadTagDataFromFile()

void BMD.LoadTagDataFromFile ( byte[] buffer,
EndianBinaryReader reader,
int tagCount,
List< BTI > externalBTIs,
bool isModel )

◆ MergeCurvesToAnimation()

ZeldaAnimation BMD.MergeCurvesToAnimation ( AnimationSetup.AnimationCurveHolder curve1,
AnimationSetup.AnimationCurveHolder curve2,
LoopType loopType = LoopType::Once,
AnimationBehavior animationBehavior = AnimationBehavior::GoBack )

◆ MoveToTarget()

void BMD.MoveToTarget ( Transform target,
float moveSpeed,
float acceleration,
float deceleration )

◆ OnDrawGizmos()

void BMD.OnDrawGizmos ( )
private

◆ OverwriteMaterial() [1/2]

BMD BMD.OverwriteMaterial ( int sourceMaterialIndex,
Material material )

◆ OverwriteMaterial() [2/2]

BMD BMD.OverwriteMaterial ( Material material)

◆ Parse()

void BMD.Parse ( string name,
byte[] buffer,
List< BTI > externalBTIs,
bool isModel = false,
bool useRigidbody = false )

◆ PlayAnimationFromDifferentArchive()

BMD BMD.PlayAnimationFromDifferentArchive ( string archive,
string name )

◆ PlayFacialBTP()

void BMD.PlayFacialBTP ( string btpName,
string external = "" )

◆ PlayNextState()

void BMD.PlayNextState ( ZeldaAnimation[] states,
int currentIndex )
private

◆ PlaySequencedAnimation()

void BMD.PlaySequencedAnimation ( params ZeldaAnimation[] states)

◆ PrepareAnimation()

void BMD.PrepareAnimation ( )

◆ PrepareShape()

void BMD.PrepareShape ( GameObject target,
int shapeIndex,
List< BTI > externalBTIs,
IList< SkeletonJoint > boneList,
Matrix4[] boneTransforms,
bool isModel )
private

◆ PrepareWeights()

void BMD.PrepareWeights ( )

◆ RecursiveFindChild()

Transform BMD.RecursiveFindChild ( Transform parent,
string childName )
private

◆ RemoveCollision()

void BMD.RemoveCollision ( )

◆ ResetRotation()

BMD BMD.ResetRotation ( )

◆ RotateByPivot()

void BMD.RotateByPivot ( float target)

◆ RotateX()

BMD BMD.RotateX ( int angle)

◆ RotateXShort()

BMD BMD.RotateXShort ( int shortAngle)

◆ RotateY()

BMD BMD.RotateY ( int angle)

◆ RotateYShort()

BMD BMD.RotateYShort ( int shortAngle)

◆ SetBaseScale()

BMD BMD.SetBaseScale ( Vector3 scale)

◆ SetLocalPosition()

BMD BMD.SetLocalPosition ( Vector3 translation)

◆ SetLocalRotation()

BMD BMD.SetLocalRotation ( Vector3 translation)

◆ SetLocalScale()

BMD BMD.SetLocalScale ( Vector3 scale)

◆ SetParentJoint()

BMD BMD.SetParentJoint ( BMD parent,
string jointName )

◆ SetParticles()

void BMD.SetParticles ( int groupID,
int subId )

◆ SetPosition()

BMD BMD.SetPosition ( Vector3 translation)

◆ SetRotation()

BMD BMD.SetRotation ( Vector3 rotation)

◆ ShortToRadians()

float BMD.ShortToRadians ( int shortValue)
private

◆ ToUrpLitShader()

BMD BMD.ToUrpLitShader ( )

◆ Translate()

BMD BMD.Translate ( Vector3 translation)

◆ TranslateLocal()

BMD BMD.TranslateLocal ( Vector3 translation)

◆ UseSameAnimationAsOriginalModelForCopy()

BMD BMD.UseSameAnimationAsOriginalModelForCopy ( BMD original)

Member Data Documentation

◆ _animancer

AnimancerComponent BMD._animancer

◆ _animationClips

Dictionary<string, AnimationClip> BMD._animationClips = new Dictionary<string, AnimationClip>()

◆ _animator

Animator BMD._animator

◆ _eyeTextures

List<EyeTexture> BMD._eyeTextures = new List<EyeTexture>()
private

◆ _forceStopMove

bool BMD._forceStopMove = false
private

◆ _meshRenderers

List<Renderer> BMD._meshRenderers = new List<Renderer>()

◆ _storedMaterials

List<StoredMaterial> BMD._storedMaterials = new List<StoredMaterial>()
private

◆ Actor

Actor BMD.Actor

◆ Archive

Archive BMD.Archive

◆ CachedAnimationsNormals

Dictionary<int, Vector3[]> BMD.CachedAnimationsNormals = new Dictionary<int, Vector3[]>()

◆ CachedAnimationsVerts

Dictionary<int, Vector3[]> BMD.CachedAnimationsVerts = new Dictionary<int, Vector3[]>()

◆ CacheMeshes

bool BMD.CacheMeshes = false

◆ CheckCached

bool BMD.CheckCached = false

◆ checkForExternalCache

bool BMD.checkForExternalCache = true
private

◆ Childs

List<GameObject> BMD.Childs = new List<GameObject>()

◆ CompressedAnimations

bool BMD.CompressedAnimations = false

◆ CurrentAnimation

BCK BMD.CurrentAnimation

◆ CurrentBRK

BRK BMD.CurrentBRK

◆ CurrentBTK

BTK BMD.CurrentBTK

◆ CurrentBTP

BTP BMD.CurrentBTP
private

◆ currentSpeed

float BMD.currentSpeed
private

◆ Dialogue3DRotation

Vector3 BMD.Dialogue3DRotation

◆ DialogueId

int BMD.DialogueId

◆ DRW1Tag

DRW1 BMD.DRW1Tag

◆ EVP1Tag

EVP1 BMD.EVP1Tag

◆ externalBTIs

List<BTI> BMD.externalBTIs
private

◆ ForceCheck

bool BMD.ForceCheck = false

◆ frameCounter

int BMD.frameCounter = 0
private

◆ globalNormals

List<Vector3> BMD.globalNormals = new List<Vector3>()
private

◆ globalVerts

List<Vector3> BMD.globalVerts = new List<Vector3>()
private

◆ INF1Tag

INF1 BMD.INF1Tag

◆ initTranslation

Vector3 BMD.initTranslation = Vector3.zero

◆ IsLink

bool BMD.IsLink

◆ isModel

bool BMD.isModel
private

◆ JNT1Tag

JNT1 BMD.JNT1Tag

◆ jointGameObjects

Dictionary<string, GameObject> BMD.jointGameObjects = new Dictionary<string, GameObject>()

◆ lastAnimationName

string BMD.lastAnimationName = ""

◆ lastExternalArchiveForAnimation

string BMD.lastExternalArchiveForAnimation
private

◆ LoadAnimationsOnMainThread

bool BMD.LoadAnimationsOnMainThread = false

◆ m_tevColorOverrides

TevColorOverride BMD.m_tevColorOverrides = new TevColorOverride()
private

◆ Magic

string BMD.Magic

◆ MAT3Tag

MAT3 BMD.MAT3Tag

◆ MaxEyeTexture

int BMD.MaxEyeTexture = 2

◆ MaxUpdate

int BMD.MaxUpdate
private

◆ meshFilters

List<MeshFilter> BMD.meshFilters = new List<MeshFilter>()
private

◆ meshMaterials

List<Material> BMD.meshMaterials = new List<Material>()
private

◆ meshRenderers

List<MeshRenderer> BMD.meshRenderers = new List<MeshRenderer>()
private

◆ Name

string BMD.Name

◆ NumChunks

int BMD.NumChunks

◆ Offset

int BMD.Offset

◆ PreloadedBCKs

List<BCK> BMD.PreloadedBCKs = new List<BCK>()

◆ SHP1Tag

SHP1 BMD.SHP1Tag

◆ Size

int BMD.Size

◆ specificAnimations

Dictionary<string, AnimationSetup.AnimationCurveHolder> BMD.specificAnimations = new Dictionary<string, AnimationSetup.AnimationCurveHolder>()

◆ TEX1Tag

TEX1 BMD.TEX1Tag

◆ TexMatrixIndexes

List<TexMatrix[]> BMD.TexMatrixIndexes = new List<TexMatrix[]>()

◆ TextureDatas

List<TextureData> BMD.TextureDatas = new List<TextureData>()

◆ UpdateIndex

int BMD.UpdateIndex

◆ updateInterval

int BMD.updateInterval = 30
private

◆ VTX1Tag

VTX1 BMD.VTX1Tag

◆ WeightDataGenerator

WeightDataGenerator BMD.WeightDataGenerator

The documentation for this class was generated from the following file: