public void Parse(GameBitBuffer buffer) { Field0 = buffer.ReadInt(32); Field1 = buffer.ReadInt(32); Field2 = buffer.ReadInt(32); Field3 = new AABB(); Field3.Parse(buffer); Field4 = new AABB(); Field4.Parse(buffer); Field5 = new int[4]; for (int i = 0; i < Field5.Length; i++) Field5[i] = buffer.ReadInt(32); Field6 = buffer.ReadInt(32); }
public Scene(MpqFile file) { var stream = file.Open(); long pos = 0; // x DEADBEEF = stream.ReadInt32(); snoType = stream.ReadInt32(); unknown1 = stream.ReadInt32(); unknown2 = stream.ReadInt32(); SceneSNO = stream.ReadInt32(); unknown3 = stream.ReadInt32(); unknown4 = stream.ReadInt32(); i0 = stream.ReadInt32(); aabbBounds = new AABB(stream); aabbMarkerSetBounds = new AABB(stream); //load NavMeshDef NavMesh = new NavMeshDef(stream); // end navmeshdef var serExclusions = new SerializeData(stream); stream.Position += 56; var serInclusions = new SerializeData(stream); stream.Position += 56; //MarkerSet Time var serMarkerSets = new SerializeData(stream); pos = stream.Position; stream.Position = serMarkerSets.Offset + 16; MarkerSets = new int[serMarkerSets.Size/4]; for (int i = 0; i < serMarkerSets.Size/4; i++) { MarkerSets[i] = stream.ReadInt32(); } stream.Position = pos + 56; //TODO - parse LookLink /dark LookLink = new char[64]; for (int i = 0; i < 64; i++) { LookLink[i] = (char) stream.ReadByte(); } var sermsgTriggeredEvents = new SerializeData(stream); int i1 = stream.ReadInt32(); stream.Position += 12; //navzonedef NavZone = new NavZoneDef(stream); stream.Close(); }
public bool Intersects(AABB other) { if (// Max < o.Min this.Max.X < other.Min.X || this.Max.Y < other.Min.Y || this.Max.Z < other.Min.Z || // Min > o.Max this.Min.X > other.Max.X || this.Min.Y > other.Max.Y || this.Min.Z > other.Max.Z) { return false; } return true; // Intersects if above fails }
// Updated based on BoyC's 010editoer template, looks like some data at the end still isnt parsed - Darklotus public Actor(MpqFile file) { var stream = file.Open(); stream.Seek(16, SeekOrigin.Begin); this.ActorSNO = stream.ReadInt32(); stream.Position += 8; // pad 2; this.i0 = stream.ReadInt32(); this.Type = stream.ReadInt32(); this.ApperanceSNO = stream.ReadInt32(); this.snoPhysMesh = stream.ReadInt32(); this.Cyl = new AxialCylinder(stream); this.s = new Sphere(stream); this.aabbBounds = new AABB(stream); this.serTagMap = new SerializeData(stream); stream.Position += 8; // pad 2 this.AnimSetSNO = stream.ReadInt32(); this.MonsterSNO = stream.ReadInt32(); this.serMsgTriggeredEvents = new SerializeData(stream); this.i1 = stream.ReadInt32(); stream.Position += 12; // pad 3 int - DarkLotus this.v0 = new Vector3D(stream.ReadFloat(), stream.ReadFloat(), stream.ReadFloat()); this.Looks = new WeightedLook[8]; for (int i = 0; i < 8; i++) { this.Looks[i] = new WeightedLook(stream); } this.PhysicsSNO = stream.ReadInt32(); this.i2 = stream.ReadInt32(); this.i3 = stream.ReadInt32(); this.f0 = stream.ReadFloat(); this.f1 = stream.ReadFloat(); this.f2 = stream.ReadFloat(); this.padActorCollisionData = new int[17]; // Was 68/4 - Darklotus for (int i = 0; i < 17; i++) { this.padActorCollisionData[i] = stream.ReadInt32(); } this.padInventoryImages = new int[10]; //Was 5*8/4 - Darklotus for (int i = 0; i < 10; i++) { this.padInventoryImages[i] = stream.ReadInt32(); } stream.Close(); }