public static BoneAccessor Get(string name) { sbyte *n = (sbyte *)Marshal.StringToHGlobalAnsi(name); var mod = IEngineStudio.Mod_ForName(n, true); Marshal.FreeHGlobal((IntPtr)n); return(new TPoseBoneAccessor(IEngineStudio.Mod_Extradata(mod))); }
/// <summary> /// Build ragdoll to the best of its ability. /// </summary> /// <returns></returns> private static unsafe Ragdoll BuildInternal(string modelName) { // try build from file // otherwise using build options to auto calc ragdoll. IntPtr pName = Marshal.StringToHGlobalAnsi(modelName); var model = IEngineStudio.Mod_ForName((sbyte *)pName, true); Marshal.FreeHGlobal(pName); var hdr = IEngineStudio.Mod_Extradata(model); throw new NotImplementedException(); }
private static BippedBone GenerateBippedBone(model_t *pModel) { var pStudioModel = IEngineStudio.Mod_Extradata(pModel); BippedBone result = new BippedBone(); // If there exist any naming convension to find all index great than 0. if (_boneNamings.Any( x => _namingFields.All( field => { var index = GetBoneIndex((string)field.GetValue(x), pStudioModel); _bippedBoneType.GetField(field.Name).SetValue(result, index); return(index > 0); }) )) { return(result); } else { return(null); } }
public static BoneAccessor Get(int index) { var mod = IEngineStudio.GetModelByIndex(index); return(new TPoseBoneAccessor(IEngineStudio.Mod_Extradata(mod))); }
public unsafe static Ragdoll Build(model_t *model) { return(BuildBipped(IEngineStudio.Mod_Extradata(model), BippedBoneManager.GetBippedBone(model), BoneAccessor.Get(IEngineStudio.Mod_Extradata(model)))); }