public GeometryModifiersData findGeomModifier(string modelname, string trick_path) { string[] parts = modelname.Split(new string[] { "__" }, StringSplitOptions.None); if (parts.Length < 2) { return(null); } List <string> elems = new List <string>(parts); elems.RemoveAt(0); string bone_trick_name = string.Join("__", elems); GeometryModifiersData result = null; g_tricks_string_hash_tab.TryGetValue(bone_trick_name.ToLower(), out result); if (result != null) { return(result); } Debug.LogFormat("Found modifier for {0} {1} : {2}", trick_path, modelname, bone_trick_name.ToLower()); return(null); }
void addModelStubs(GeoSet geoset) { RuntimeData rd = RuntimeData.get(); foreach (Model m in geoset.subs) { GeometryModifiersData gmod = rd.m_modifiers.findGeomModifier(m.name, ""); if (gmod != null) { if (null == m.trck_node) { m.trck_node = new ModelModifiers(); } if (m.name == "_FLRSHPS_WIN_H__FLRSHPS_Window") { Debug.LogFormat("GMod for geoset model {0}", gmod); } m.trck_node = gmod.node.clone(); m.src_mod = gmod; } } }
public void groupApplyModifiers() { RuntimeData rd = RuntimeData.get(); Model model = m_model; if (null == model) { return; } GeometryModifiersData mods = rd.m_modifiers.findGeomModifier(model.name, m_dir); if (null == mods) { return; } if (mods.LodNear != 0.0f) { lod_near = mods.LodNear; } if (mods.LodFar != 0.0f) { lod_far = mods.LodFar; } if (mods.LodNearFade != 0.0f) { lod_near_fade = mods.LodNearFade; } if (mods.LodFarFade != 0.0f) { lod_far_fade = mods.LodFarFade; } if (mods.LodScale != 0.0f) { lod_scale = mods.LodScale; } GroupFlags v1 = (GroupFlags)mods.GroupFlags; shadow_dist = mods.ShadowDist; parent_fade = v1.HasFlag(GroupFlags.ParentFade); region_marker = v1.HasFlag(GroupFlags.RegionMarker); volume_trigger = v1.HasFlag(GroupFlags.VolumeTrigger); water_volume = v1.HasFlag(GroupFlags.WaterVolume); lava_volume = v1.HasFlag(GroupFlags.LavaVolume); sewer_volume = v1.HasFlag(GroupFlags.SewerWaterVolume); door_volume = v1.HasFlag(GroupFlags.DoorVolume); key_light = v1.HasFlag(GroupFlags.KeyLight); tray = v1.HasFlag(GroupFlags.VisTray) | v1.HasFlag(GroupFlags.VisOutside); if (mods.LodNear != 0.0f || mods.LodFar != 0.0f || mods.LodNearFade != 0.0f || mods.LodFarFade != 0.0f || mods.LodScale != 0.0f) { lod_fromtrick = true; } /* * if (mods.node._TrickFlags.HasFlag(TrickFlags.NoColl)) * ; //TODO: disable collisions for this node * if (mods.node._TrickFlags.HasFlag(TrickFlags.SelectOnly)) * ; // set the model's triangles as only selectable ?? ( selection mesh ? ) * if (mods.node._TrickFlags.HasFlag(TrickFlags.NotSelectable)) * ; // */ }