private void SpawnEntity(SpawnPoint.Entity entityDesc) { var entity = ObjectEntity.FromSpawnPoint(_kernel, entityDesc); entity.LoadMesh(_graphics.GraphicsDevice); _objectEntities.Add(entity); }
public void AddActor(SpawnPoint.Entity entityDesc) { var entity = ObjectEntity.FromSpawnPoint(_kernel, entityDesc); entity.LoadMesh(_graphicsDevice); _actors.Add(entity); }
private static void Run(SpawnPoint.Entity entity, int index) { var objs = _ctrl.CurrentSpawnPoint.ObjEntryCtrl; if (ImGui.BeginCombo($"Object##{index}", objs.GetName(entity.ObjectId))) { var filter = ObjectFilter; if (ImGui.InputText($"Filter##{index}", ref filter, 16)) { ObjectFilter = filter; } foreach (var obj in objs.ObjectEntries.Where(x => filter.Length == 0 || x.ModelName.Contains(filter))) { if (ImGui.Selectable(obj.ModelName, obj.ObjectId == entity.ObjectId)) { entity.ObjectId = (int)obj.ObjectId; } } ImGui.EndCombo(); } ForEdit3($"Position##{index}", () => new Vector3(entity.PositionX, entity.PositionY, entity.PositionZ), x => { entity.PositionX = x.X; entity.PositionY = x.Y; entity.PositionZ = x.Z; }); ForEdit3($"Rotation##{index}", () => new Vector3( (float)(entity.RotationX * 180f / Math.PI), (float)(entity.RotationY * 180f / Math.PI), (float)(entity.RotationZ * 180f / Math.PI)), x => { entity.RotationX = (float)(x.X / 180f * Math.PI); entity.RotationY = (float)(x.Y / 180f * Math.PI); entity.RotationZ = (float)(x.Z / 180f * Math.PI); }); ForEdit($"Spawn type##{index}", () => entity.SpawnType, x => entity.SpawnType = x); ForEdit($"Spawn arg##{index}", () => entity.SpawnArgument, x => entity.SpawnArgument = x); ForEdit($"Serial##{index}", () => entity.Serial, x => entity.Serial = x); ForEdit($"Argument 1##{index}", () => entity.Argument1, x => entity.Argument1 = x); ForEdit($"Argument 2##{index}", () => entity.Argument2, x => entity.Argument2 = x); ForEdit($"Reaction command##{index}", () => entity.ReactionCommand, x => entity.ReactionCommand = x); ForEdit($"Spawn delay##{index}", () => entity.SpawnDelay, x => entity.SpawnDelay = x); ForEdit($"Command##{index}", () => entity.Command, x => entity.Command = x); ForEdit($"Spawn range##{index}", () => entity.SpawnRange, x => entity.SpawnRange = x); ForEdit($"Level##{index}", () => entity.Level, x => entity.Level = x); ForEdit($"Medal##{index}", () => entity.Medal, x => entity.Medal = x); }
private static void Run(SpawnPoint.Entity entity, int index) { var objs = _ctrl.CurrentSpawnPoint.ObjEntryCtrl; if (ImGui.BeginCombo($"Object#{index}", objs.GetName(entity.ObjectId))) { var filter = ObjectFilter; if (ImGui.InputText($"Filter#{index}", ref filter, 16)) { ObjectFilter = filter; } foreach (var obj in objs.ObjectEntries.Where(x => filter.Length == 0 || x.ModelName.Contains(filter))) { if (ImGui.Selectable(obj.ModelName, obj.ObjectId == entity.ObjectId)) { entity.ObjectId = obj.ObjectId; } } ImGui.EndCombo(); } ForEdit3($"Position#{index}", () => new Vector3(entity.PositionX, entity.PositionY, entity.PositionZ), x => { entity.PositionX = x.X; entity.PositionY = x.Y; entity.PositionZ = x.Z; }); ForEdit3($"Rotation#{index}", () => new Vector3( (float)(entity.RotationX * 180f / Math.PI), (float)(entity.RotationY * 180f / Math.PI), (float)(entity.RotationZ * 180f / Math.PI)), x => { entity.RotationX = (float)(x.X / 180f * Math.PI); entity.RotationY = (float)(x.Y / 180f * Math.PI); entity.RotationZ = (float)(x.Z / 180f * Math.PI); }); ForEdit($"Use entrance#{index}", () => entity.UseEntrance, x => entity.UseEntrance = x); ForEdit($"Entrance ID#{index}", () => entity.Entrance, x => entity.Entrance = x); ForEdit($"Unk1e#{index}", () => entity.Unk1e, x => entity.Unk1e = x); ForEdit($"Unk20#{index}", () => entity.Unk20, x => entity.Unk20 = x); ForEdit($"Ai Parameter#{index}", () => entity.AiParameter, x => entity.AiParameter = x); ForEdit($"TalkMessage#{index}", () => entity.TalkMessage, x => entity.TalkMessage = x); ForEdit($"ReactionCommand#{index}", () => entity.ReactionCommand, x => entity.ReactionCommand = x); ForEdit($"Unk30#{index}", () => entity.Unk30, x => entity.Unk30 = x); }
public static ObjectEntity FromSpawnPoint(Kernel kernel, SpawnPoint.Entity spawnPoint) => new ObjectEntity(kernel, spawnPoint.ObjectId) { Position = new Vector3(spawnPoint.PositionX, -spawnPoint.PositionY, -spawnPoint.PositionZ), Rotation = new Vector3(spawnPoint.RotationX, spawnPoint.RotationY, spawnPoint.RotationZ), };