public static void WriteFloat(float val, OStream s) => s.Write(BitConverter.GetBytes(val), 0, 4);
/*! NIFLIB_HIDDEN function. For internal use only. */ internal override void Write(OStream s, Dictionary <NiObject, uint> link_map, List <NiObject> missing_link_stack, NifInfo info) { base.Write(s, link_map, missing_link_stack, info); numParticles = (ushort)particles.Count; particleUnknownShort = (ushort)unknownFloats2.Count; if (info.version <= 0x03010000) { Nif.NifStream(oldSpeed, s, info); } if (info.version >= 0x0303000D) { Nif.NifStream(speed, s, info); } Nif.NifStream(speedRandom, s, info); Nif.NifStream(verticalDirection, s, info); Nif.NifStream(verticalAngle, s, info); Nif.NifStream(horizontalDirection, s, info); Nif.NifStream(horizontalAngle, s, info); Nif.NifStream(unknownNormal_, s, info); Nif.NifStream(unknownColor_, s, info); Nif.NifStream(size, s, info); Nif.NifStream(emitStartTime, s, info); Nif.NifStream(emitStopTime, s, info); if (info.version >= 0x04000002) { Nif.NifStream(unknownByte, s, info); } if (info.version <= 0x03010000) { Nif.NifStream(oldEmitRate, s, info); } if (info.version >= 0x0303000D) { Nif.NifStream(emitRate, s, info); } Nif.NifStream(lifetime, s, info); Nif.NifStream(lifetimeRandom, s, info); if (info.version >= 0x04000002) { Nif.NifStream(emitFlags, s, info); } Nif.NifStream(startRandom, s, info); WriteRef((NiObject)emitter, s, info, link_map, missing_link_stack); if (info.version >= 0x04000002) { Nif.NifStream(unknownShort2_, s, info); Nif.NifStream(unknownFloat13_, s, info); Nif.NifStream(unknownInt1_, s, info); Nif.NifStream(unknownInt2_, s, info); Nif.NifStream(unknownShort3_, s, info); } if (info.version <= 0x03010000) { Nif.NifStream(particleVelocity, s, info); Nif.NifStream(particleUnknownVector, s, info); Nif.NifStream(particleLifetime, s, info); WriteRef((NiObject)particleLink, s, info, link_map, missing_link_stack); Nif.NifStream(particleTimestamp, s, info); Nif.NifStream(particleUnknownShort, s, info); Nif.NifStream(particleVertexId, s, info); } if (info.version >= 0x04000002) { Nif.NifStream(numParticles, s, info); Nif.NifStream(numValid, s, info); for (var i4 = 0; i4 < particles.Count; i4++) { Nif.NifStream(particles[i4].velocity, s, info); Nif.NifStream(particles[i4].unknownVector, s, info); Nif.NifStream(particles[i4].lifetime, s, info); Nif.NifStream(particles[i4].lifespan, s, info); Nif.NifStream(particles[i4].timestamp, s, info); Nif.NifStream(particles[i4].unknownShort, s, info); Nif.NifStream(particles[i4].vertexId, s, info); } WriteRef((NiObject)unknownLink, s, info, link_map, missing_link_stack); } WriteRef((NiObject)particleExtra, s, info, link_map, missing_link_stack); WriteRef((NiObject)unknownLink2, s, info, link_map, missing_link_stack); if (info.version >= 0x04000002) { Nif.NifStream(trailer, s, info); } if (info.version <= 0x03010000) { WriteRef((NiObject)colorData, s, info, link_map, missing_link_stack); Nif.NifStream(unknownFloat1, s, info); for (var i4 = 0; i4 < unknownFloats2.Count; i4++) { Nif.NifStream(unknownFloats2[i4], s, info); } } }
/*! NIFLIB_HIDDEN function. For internal use only. */ internal override void Write(OStream s, Dictionary <NiObject, uint> link_map, List <NiObject> missing_link_stack, NifInfo info) { base.Write(s, link_map, missing_link_stack, info); Nif.NifStream(floatsExtraDataIndex, s, info); }
/*! NIFLIB_HIDDEN function. For internal use only. */ internal override void Write(OStream s, Dictionary <NiObject, uint> link_map, List <NiObject> missing_link_stack, NifInfo info) { base.Write(s, link_map, missing_link_stack, info); Nif.NifStream(palette.palette, s, info); Nif.NifStream(palette.length, s, info); }
/*! NIFLIB_HIDDEN function. For internal use only. */ internal override void Write(OStream s, Dictionary <NiObject, uint> link_map, List <NiObject> missing_link_stack, NifInfo info) { base.Write(s, link_map, missing_link_stack, info); numConstraints = (uint)constraints.Count; Nif.NifStream(collisionResponse, s, info); Nif.NifStream(unusedByte1, s, info); Nif.NifStream(processContactCallbackDelay, s, info); if (info.version >= 0x0A010000) { Nif.NifStream(unknownInt1, s, info); if ((info.version <= 0x14000005) && ((info.userVersion2 < 16))) { Nif.NifStream(havokFilterCopy.layer_ob, s, info); } if (((info.version == 0x14020007) && (info.userVersion2 <= 34))) { Nif.NifStream(havokFilterCopy.layer_fo, s, info); } if (((info.version == 0x14020007) && (info.userVersion2 > 34))) { Nif.NifStream(havokFilterCopy.layer_sk, s, info); } Nif.NifStream(havokFilterCopy.flagsAndPartNumber, s, info); Nif.NifStream(havokFilterCopy.group, s, info); for (var i2 = 0; i2 < 4; i2++) { Nif.NifStream(unused2[i2], s, info); } } if ((info.version >= 0x0A010000) && ((info.userVersion2 > 34))) { Nif.NifStream(unknownInt2, s, info); } if (info.version >= 0x0A010000) { Nif.NifStream(collisionResponse2, s, info); Nif.NifStream(unusedByte2, s, info); Nif.NifStream(processContactCallbackDelay2, s, info); } if ((info.userVersion2 <= 34)) { Nif.NifStream((uint)unknownInt2, s, info); } Nif.NifStream(translation, s, info); Nif.NifStream(rotation.x, s, info); Nif.NifStream(rotation.y, s, info); Nif.NifStream(rotation.z, s, info); Nif.NifStream(rotation.w, s, info); Nif.NifStream(linearVelocity, s, info); Nif.NifStream(angularVelocity, s, info); Nif.NifStream(inertiaTensor, s, info); Nif.NifStream(center, s, info); Nif.NifStream(mass, s, info); Nif.NifStream(linearDamping, s, info); Nif.NifStream(angularDamping, s, info); if ((info.userVersion2 > 34)) { Nif.NifStream(timeFactor, s, info); } if (((info.userVersion2 > 34) && (info.userVersion2 != 130))) { Nif.NifStream(gravityFactor, s, info); } Nif.NifStream(friction, s, info); if ((info.userVersion2 > 34)) { Nif.NifStream(rollingFrictionMultiplier, s, info); } Nif.NifStream(restitution, s, info); if (info.version >= 0x0A010000) { Nif.NifStream(maxLinearVelocity, s, info); Nif.NifStream(maxAngularVelocity, s, info); } if ((info.version >= 0x0A010000) && ((info.userVersion2 != 130))) { Nif.NifStream(penetrationDepth, s, info); } Nif.NifStream(motionSystem, s, info); if ((info.userVersion2 <= 34)) { Nif.NifStream(deactivatorType, s, info); } if ((info.userVersion2 > 34)) { Nif.NifStream(enableDeactivation, s, info); } Nif.NifStream(solverDeactivation, s, info); Nif.NifStream(qualityType, s, info); if ((info.userVersion2 == 130)) { Nif.NifStream((float)penetrationDepth, s, info); Nif.NifStream(unknownFloat1, s, info); } for (var i1 = 0; i1 < 12; i1++) { Nif.NifStream(unknownBytes1[i1], s, info); } if ((info.userVersion2 > 34)) { for (var i2 = 0; i2 < 4; i2++) { Nif.NifStream(unknownBytes2[i2], s, info); } } Nif.NifStream(numConstraints, s, info); for (var i1 = 0; i1 < constraints.Count; i1++) { WriteRef((NiObject)constraints[i1], s, info, link_map, missing_link_stack); } if ((info.userVersion2 < 76)) { Nif.NifStream(bodyFlags, s, info); } if ((info.userVersion2 >= 76)) { Nif.NifStream((ushort)bodyFlags, s, info); } }
/*! NIFLIB_HIDDEN function. For internal use only. */ internal override void Write(OStream s, Dictionary <NiObject, uint> link_map, List <NiObject> missing_link_stack, NifInfo info) { base.Write(s, link_map, missing_link_stack, info); numControlledBlocks = (uint)controlledBlocks.Count; Nif.NifStream(name, s, info); if (info.version <= 0x0A010067) { Nif.NifStream(accumRootName, s, info); WriteRef((NiObject)textKeys, s, info, link_map, missing_link_stack); } if (info.version >= 0x14030009 && info.version <= 0x14030009 && info.userVersion == 131072) { Nif.NifStream(unknownInt4, s, info); Nif.NifStream(unknownInt5, s, info); } Nif.NifStream(numControlledBlocks, s, info); if (info.version >= 0x0A01006A) { Nif.NifStream(arrayGrowBy, s, info); } for (var i3 = 0; i3 < controlledBlocks.Count; i3++) { if (info.version <= 0x0A010067) { Nif.NifStream(controlledBlocks[i3].targetName, s, info); } if (info.version >= 0x0A01006A) { WriteRef((NiObject)controlledBlocks[i3].interpolator, s, info, link_map, missing_link_stack); } if (info.version <= 0x14050000) { WriteRef((NiObject)controlledBlocks[i3].controller, s, info, link_map, missing_link_stack); } if (info.version >= 0x0A010068 && info.version <= 0x0A01006E) { WriteRef((NiObject)controlledBlocks[i3].blendInterpolator, s, info, link_map, missing_link_stack); Nif.NifStream(controlledBlocks[i3].blendIndex, s, info); } if (info.version >= 0x0A01006A && ((info.userVersion2 > 0))) { Nif.NifStream(controlledBlocks[i3].priority, s, info); } if (info.version >= 0x0A010068 && info.version <= 0x0A010071) { Nif.NifStream(controlledBlocks[i3].nodeName, s, info); Nif.NifStream(controlledBlocks[i3].propertyType, s, info); Nif.NifStream(controlledBlocks[i3].controllerType, s, info); Nif.NifStream(controlledBlocks[i3].controllerId, s, info); Nif.NifStream(controlledBlocks[i3].interpolatorId, s, info); } if (info.version >= 0x0A020000 && info.version <= 0x14010000) { WriteRef((NiObject)controlledBlocks[i3].stringPalette, s, info, link_map, missing_link_stack); Nif.NifStream(controlledBlocks[i3].nodeNameOffset, s, info); Nif.NifStream(controlledBlocks[i3].propertyTypeOffset, s, info); Nif.NifStream(controlledBlocks[i3].controllerTypeOffset, s, info); Nif.NifStream(controlledBlocks[i3].controllerIdOffset, s, info); Nif.NifStream(controlledBlocks[i3].interpolatorIdOffset, s, info); } if (info.version >= 0x14010001) { Nif.NifStream((IndexString)controlledBlocks[i3].nodeName, s, info); Nif.NifStream((IndexString)controlledBlocks[i3].propertyType, s, info); Nif.NifStream((IndexString)controlledBlocks[i3].controllerType, s, info); Nif.NifStream((IndexString)controlledBlocks[i3].controllerId, s, info); Nif.NifStream((IndexString)controlledBlocks[i3].interpolatorId, s, info); } } }
/*! NIFLIB_HIDDEN function. For internal use only. */ internal override void Write(OStream s, Dictionary <NiObject, uint> link_map, List <NiObject> missing_link_stack, NifInfo info) { base.Write(s, link_map, missing_link_stack, info); numVertices = (ushort)vertices.Count; if (info.version >= 0x0A010072) { Nif.NifStream(groupId, s, info); } if ((!IsDerivedType(NiPSysData.TYPE))) { Nif.NifStream(numVertices, s, info); } if ((info.userVersion2 < 34)) { if (IsDerivedType(NiPSysData.TYPE)) { Nif.NifStream((ushort)numVertices, s, info); } } if ((info.userVersion2 >= 34)) { if (IsDerivedType(NiPSysData.TYPE)) { Nif.NifStream(bsMaxVertices, s, info); } } if (info.version >= 0x0A010000) { Nif.NifStream(keepFlags, s, info); Nif.NifStream(compressFlags, s, info); } Nif.NifStream(hasVertices, s, info); if (hasVertices) { for (var i4 = 0; i4 < vertices.Count; i4++) { Nif.NifStream(vertices[i4], s, info); } } if (info.version >= 0x0A000100 && ((!((info.version == 0x14020007) && (info.userVersion2 > 0))))) { Nif.NifStream(vectorFlags, s, info); } if (((info.version == 0x14020007) && (info.userVersion2 > 0))) { Nif.NifStream(bsVectorFlags, s, info); } if (info.version >= 0x14020007 && info.version <= 0x14020007 && info.userVersion == 12) { Nif.NifStream(materialCrc, s, info); } Nif.NifStream(hasNormals, s, info); if (hasNormals) { for (var i4 = 0; i4 < normals.Count; i4++) { Nif.NifStream(normals[i4], s, info); } } if (info.version >= 0x0A010000) { if ((hasNormals && ((vectorFlags | bsVectorFlags) & 4096))) { for (var i5 = 0; i5 < tangents.Count; i5++) { Nif.NifStream(tangents[i5], s, info); } for (var i5 = 0; i5 < bitangents.Count; i5++) { Nif.NifStream(bitangents[i5], s, info); } } } Nif.NifStream(center, s, info); Nif.NifStream(radius, s, info); if (info.version >= 0x14030009 && info.version <= 0x14030009 && info.userVersion == 131072) { for (var i4 = 0; i4 < 13; i4++) { Nif.NifStream(unknown13Shorts[i4], s, info); } } Nif.NifStream(hasVertexColors, s, info); if (hasVertexColors) { for (var i4 = 0; i4 < vertexColors.Count; i4++) { Nif.NifStream(vertexColors[i4], s, info); } } if (info.version <= 0x04020200) { Nif.NifStream(numUvSets, s, info); } if (info.version <= 0x04000002) { Nif.NifStream(hasUv, s, info); } for (var i3 = 0; i3 < uvSets.Count; i3++) { for (var i4 = 0; i4 < uvSets[i3].Count; i4++) { Nif.NifStream(uvSets[i3][i4], s, info); } } if (info.version >= 0x0A000100) { Nif.NifStream(consistencyFlags, s, info); } if (info.version >= 0x14000004) { WriteRef((NiObject)additionalData, s, info, link_map, missing_link_stack); } }
public static void NifStream(float val, OStream s, NifInfo info) => WriteFloat(val, s);
public static void NifStream(string val, OStream s, NifInfo info) => WriteString(val, s);
public static void NifStream(byte val, OStream s, NifInfo info) => WriteByte(val, s);
public static void NifStream(bool val, OStream s, NifInfo info) => WriteBool(val, s, info.version);
public static void NifStream(short val, OStream s, NifInfo info) => WriteShort(val, s);
public static void NifStream(uint val, OStream s, NifInfo info) => WriteUInt(val, s);
public static void WriteString(string val, OStream s) { var buf = Encoding.ASCII.GetBytes(val); WriteUInt((uint)buf.Length, s); s.Write(buf, 0, buf.Length); }
public static void NifStream <T>(Key <T> key, OStream file, NifInfo info, int type) => NifStream(key, file, info, (KeyType)type);
public static void NifStream(TexCoord val, OStream s, NifInfo info) { WriteFloat(val.u, s); WriteFloat(val.v, s); }
/*! NIFLIB_HIDDEN function. For internal use only. */ internal override void Write(OStream s, Dictionary <NiObject, uint> link_map, List <NiObject> missing_link_stack, NifInfo info) { base.Write(s, link_map, missing_link_stack, info); Nif.NifStream(malleable.type, s, info); Nif.NifStream(malleable.numEntities, s, info); WriteRef((NiObject)malleable.entityA, s, info, link_map, missing_link_stack); WriteRef((NiObject)malleable.entityB, s, info, link_map, missing_link_stack); Nif.NifStream(malleable.priority, s, info); if ((malleable.type == 0)) { Nif.NifStream(malleable.ballAndSocket.pivotA, s, info); Nif.NifStream(malleable.ballAndSocket.pivotB, s, info); } if ((malleable.type == 1)) { if (info.version <= 0x14000005) { Nif.NifStream(malleable.hinge.pivotA, s, info); Nif.NifStream(malleable.hinge.perpAxisInA1, s, info); Nif.NifStream(malleable.hinge.perpAxisInA2, s, info); Nif.NifStream(malleable.hinge.pivotB, s, info); Nif.NifStream(malleable.hinge.axisB, s, info); } if (info.version >= 0x14020007) { Nif.NifStream(malleable.hinge.axisA, s, info); Nif.NifStream((Vector4)malleable.hinge.perpAxisInA1, s, info); Nif.NifStream((Vector4)malleable.hinge.perpAxisInA2, s, info); Nif.NifStream((Vector4)malleable.hinge.pivotA, s, info); Nif.NifStream((Vector4)malleable.hinge.axisB, s, info); Nif.NifStream(malleable.hinge.perpAxisInB1, s, info); Nif.NifStream(malleable.hinge.perpAxisInB2, s, info); Nif.NifStream((Vector4)malleable.hinge.pivotB, s, info); } } if ((malleable.type == 2)) { if ((info.userVersion2 <= 16)) { Nif.NifStream(malleable.limitedHinge.pivotA, s, info); Nif.NifStream(malleable.limitedHinge.axisA, s, info); Nif.NifStream(malleable.limitedHinge.perpAxisInA1, s, info); Nif.NifStream(malleable.limitedHinge.perpAxisInA2, s, info); Nif.NifStream(malleable.limitedHinge.pivotB, s, info); Nif.NifStream(malleable.limitedHinge.axisB, s, info); Nif.NifStream(malleable.limitedHinge.perpAxisInB2, s, info); } if ((info.userVersion2 > 16)) { Nif.NifStream((Vector4)malleable.limitedHinge.axisA, s, info); Nif.NifStream((Vector4)malleable.limitedHinge.perpAxisInA1, s, info); Nif.NifStream((Vector4)malleable.limitedHinge.perpAxisInA2, s, info); Nif.NifStream((Vector4)malleable.limitedHinge.pivotA, s, info); Nif.NifStream((Vector4)malleable.limitedHinge.axisB, s, info); Nif.NifStream(malleable.limitedHinge.perpAxisInB1, s, info); Nif.NifStream((Vector4)malleable.limitedHinge.perpAxisInB2, s, info); Nif.NifStream((Vector4)malleable.limitedHinge.pivotB, s, info); } Nif.NifStream(malleable.limitedHinge.minAngle, s, info); Nif.NifStream(malleable.limitedHinge.maxAngle, s, info); Nif.NifStream(malleable.limitedHinge.maxFriction, s, info); if ((info.version >= 0x14020007) && ((info.userVersion2 > 16))) { Nif.NifStream(malleable.limitedHinge.motor.type, s, info); if ((malleable.limitedHinge.motor.type == 1)) { Nif.NifStream(malleable.limitedHinge.motor.positionMotor.minForce, s, info); Nif.NifStream(malleable.limitedHinge.motor.positionMotor.maxForce, s, info); Nif.NifStream(malleable.limitedHinge.motor.positionMotor.tau, s, info); Nif.NifStream(malleable.limitedHinge.motor.positionMotor.damping, s, info); Nif.NifStream(malleable.limitedHinge.motor.positionMotor.proportionalRecoveryVelocity, s, info); Nif.NifStream(malleable.limitedHinge.motor.positionMotor.constantRecoveryVelocity, s, info); Nif.NifStream(malleable.limitedHinge.motor.positionMotor.motorEnabled, s, info); } if ((malleable.limitedHinge.motor.type == 2)) { Nif.NifStream(malleable.limitedHinge.motor.velocityMotor.minForce, s, info); Nif.NifStream(malleable.limitedHinge.motor.velocityMotor.maxForce, s, info); Nif.NifStream(malleable.limitedHinge.motor.velocityMotor.tau, s, info); Nif.NifStream(malleable.limitedHinge.motor.velocityMotor.targetVelocity, s, info); Nif.NifStream(malleable.limitedHinge.motor.velocityMotor.useVelocityTarget, s, info); Nif.NifStream(malleable.limitedHinge.motor.velocityMotor.motorEnabled, s, info); } if ((malleable.limitedHinge.motor.type == 3)) { Nif.NifStream(malleable.limitedHinge.motor.springDamperMotor.minForce, s, info); Nif.NifStream(malleable.limitedHinge.motor.springDamperMotor.maxForce, s, info); Nif.NifStream(malleable.limitedHinge.motor.springDamperMotor.springConstant, s, info); Nif.NifStream(malleable.limitedHinge.motor.springDamperMotor.springDamping, s, info); Nif.NifStream(malleable.limitedHinge.motor.springDamperMotor.motorEnabled, s, info); } } } if ((malleable.type == 6)) { if (info.version <= 0x14000005) { Nif.NifStream(malleable.prismatic.pivotA, s, info); Nif.NifStream(malleable.prismatic.rotationA, s, info); Nif.NifStream(malleable.prismatic.planeA, s, info); Nif.NifStream(malleable.prismatic.slidingA, s, info); Nif.NifStream(malleable.prismatic.slidingB, s, info); Nif.NifStream(malleable.prismatic.pivotB, s, info); Nif.NifStream(malleable.prismatic.rotationB, s, info); Nif.NifStream(malleable.prismatic.planeB, s, info); } if (info.version >= 0x14020007) { Nif.NifStream((Vector4)malleable.prismatic.slidingA, s, info); Nif.NifStream((Vector4)malleable.prismatic.rotationA, s, info); Nif.NifStream((Vector4)malleable.prismatic.planeA, s, info); Nif.NifStream((Vector4)malleable.prismatic.pivotA, s, info); Nif.NifStream((Vector4)malleable.prismatic.slidingB, s, info); Nif.NifStream((Vector4)malleable.prismatic.rotationB, s, info); Nif.NifStream((Vector4)malleable.prismatic.planeB, s, info); Nif.NifStream((Vector4)malleable.prismatic.pivotB, s, info); } Nif.NifStream(malleable.prismatic.minDistance, s, info); Nif.NifStream(malleable.prismatic.maxDistance, s, info); Nif.NifStream(malleable.prismatic.friction, s, info); if ((info.version >= 0x14020007) && ((info.userVersion2 > 16))) { Nif.NifStream(malleable.prismatic.motor.type, s, info); if ((malleable.prismatic.motor.type == 1)) { Nif.NifStream(malleable.prismatic.motor.positionMotor.minForce, s, info); Nif.NifStream(malleable.prismatic.motor.positionMotor.maxForce, s, info); Nif.NifStream(malleable.prismatic.motor.positionMotor.tau, s, info); Nif.NifStream(malleable.prismatic.motor.positionMotor.damping, s, info); Nif.NifStream(malleable.prismatic.motor.positionMotor.proportionalRecoveryVelocity, s, info); Nif.NifStream(malleable.prismatic.motor.positionMotor.constantRecoveryVelocity, s, info); Nif.NifStream(malleable.prismatic.motor.positionMotor.motorEnabled, s, info); } if ((malleable.prismatic.motor.type == 2)) { Nif.NifStream(malleable.prismatic.motor.velocityMotor.minForce, s, info); Nif.NifStream(malleable.prismatic.motor.velocityMotor.maxForce, s, info); Nif.NifStream(malleable.prismatic.motor.velocityMotor.tau, s, info); Nif.NifStream(malleable.prismatic.motor.velocityMotor.targetVelocity, s, info); Nif.NifStream(malleable.prismatic.motor.velocityMotor.useVelocityTarget, s, info); Nif.NifStream(malleable.prismatic.motor.velocityMotor.motorEnabled, s, info); } if ((malleable.prismatic.motor.type == 3)) { Nif.NifStream(malleable.prismatic.motor.springDamperMotor.minForce, s, info); Nif.NifStream(malleable.prismatic.motor.springDamperMotor.maxForce, s, info); Nif.NifStream(malleable.prismatic.motor.springDamperMotor.springConstant, s, info); Nif.NifStream(malleable.prismatic.motor.springDamperMotor.springDamping, s, info); Nif.NifStream(malleable.prismatic.motor.springDamperMotor.motorEnabled, s, info); } } } if ((malleable.type == 7)) { if ((info.userVersion2 <= 16)) { Nif.NifStream(malleable.ragdoll.pivotA, s, info); Nif.NifStream(malleable.ragdoll.planeA, s, info); Nif.NifStream(malleable.ragdoll.twistA, s, info); Nif.NifStream(malleable.ragdoll.pivotB, s, info); Nif.NifStream(malleable.ragdoll.planeB, s, info); Nif.NifStream(malleable.ragdoll.twistB, s, info); } if ((info.userVersion2 > 16)) { Nif.NifStream((Vector4)malleable.ragdoll.twistA, s, info); Nif.NifStream((Vector4)malleable.ragdoll.planeA, s, info); Nif.NifStream(malleable.ragdoll.motorA, s, info); Nif.NifStream((Vector4)malleable.ragdoll.pivotA, s, info); Nif.NifStream((Vector4)malleable.ragdoll.twistB, s, info); Nif.NifStream((Vector4)malleable.ragdoll.planeB, s, info); Nif.NifStream(malleable.ragdoll.motorB, s, info); Nif.NifStream((Vector4)malleable.ragdoll.pivotB, s, info); } Nif.NifStream(malleable.ragdoll.coneMaxAngle, s, info); Nif.NifStream(malleable.ragdoll.planeMinAngle, s, info); Nif.NifStream(malleable.ragdoll.planeMaxAngle, s, info); Nif.NifStream(malleable.ragdoll.twistMinAngle, s, info); Nif.NifStream(malleable.ragdoll.twistMaxAngle, s, info); Nif.NifStream(malleable.ragdoll.maxFriction, s, info); if ((info.version >= 0x14020007) && ((info.userVersion2 > 16))) { Nif.NifStream(malleable.ragdoll.motor.type, s, info); if ((malleable.ragdoll.motor.type == 1)) { Nif.NifStream(malleable.ragdoll.motor.positionMotor.minForce, s, info); Nif.NifStream(malleable.ragdoll.motor.positionMotor.maxForce, s, info); Nif.NifStream(malleable.ragdoll.motor.positionMotor.tau, s, info); Nif.NifStream(malleable.ragdoll.motor.positionMotor.damping, s, info); Nif.NifStream(malleable.ragdoll.motor.positionMotor.proportionalRecoveryVelocity, s, info); Nif.NifStream(malleable.ragdoll.motor.positionMotor.constantRecoveryVelocity, s, info); Nif.NifStream(malleable.ragdoll.motor.positionMotor.motorEnabled, s, info); } if ((malleable.ragdoll.motor.type == 2)) { Nif.NifStream(malleable.ragdoll.motor.velocityMotor.minForce, s, info); Nif.NifStream(malleable.ragdoll.motor.velocityMotor.maxForce, s, info); Nif.NifStream(malleable.ragdoll.motor.velocityMotor.tau, s, info); Nif.NifStream(malleable.ragdoll.motor.velocityMotor.targetVelocity, s, info); Nif.NifStream(malleable.ragdoll.motor.velocityMotor.useVelocityTarget, s, info); Nif.NifStream(malleable.ragdoll.motor.velocityMotor.motorEnabled, s, info); } if ((malleable.ragdoll.motor.type == 3)) { Nif.NifStream(malleable.ragdoll.motor.springDamperMotor.minForce, s, info); Nif.NifStream(malleable.ragdoll.motor.springDamperMotor.maxForce, s, info); Nif.NifStream(malleable.ragdoll.motor.springDamperMotor.springConstant, s, info); Nif.NifStream(malleable.ragdoll.motor.springDamperMotor.springDamping, s, info); Nif.NifStream(malleable.ragdoll.motor.springDamperMotor.motorEnabled, s, info); } } } if ((malleable.type == 8)) { Nif.NifStream(malleable.stiffSpring.pivotA, s, info); Nif.NifStream(malleable.stiffSpring.pivotB, s, info); Nif.NifStream(malleable.stiffSpring.length, s, info); } if (info.version <= 0x14000005) { Nif.NifStream(malleable.tau, s, info); Nif.NifStream(malleable.damping, s, info); } if (info.version >= 0x14020007) { Nif.NifStream(malleable.strength, s, info); } }
public static void NifStream(Triangle val, OStream s, NifInfo info) { WriteUShort(val.v1, s); WriteUShort(val.v2, s); WriteUShort(val.v3, s); }
/*! NIFLIB_HIDDEN function. For internal use only. */ internal override void Write(OStream s, Dictionary <NiObject, uint> link_map, List <NiObject> missing_link_stack, NifInfo info) { base.Write(s, link_map, missing_link_stack, info); Nif.NifStream(xMotion, s, info); Nif.NifStream(yMotion, s, info); Nif.NifStream(zMotion, s, info); Nif.NifStream(swing1Motion, s, info); Nif.NifStream(swing2Motion, s, info); Nif.NifStream(twistMotion, s, info); Nif.NifStream(linearLimit.value, s, info); Nif.NifStream(linearLimit.restitution, s, info); Nif.NifStream(linearLimit.spring, s, info); Nif.NifStream(linearLimit.damping, s, info); Nif.NifStream(swing1Limit.value, s, info); Nif.NifStream(swing1Limit.restitution, s, info); Nif.NifStream(swing1Limit.spring, s, info); Nif.NifStream(swing1Limit.damping, s, info); Nif.NifStream(swing2Limit.value, s, info); Nif.NifStream(swing2Limit.restitution, s, info); Nif.NifStream(swing2Limit.spring, s, info); Nif.NifStream(swing2Limit.damping, s, info); Nif.NifStream(twistLowLimit.value, s, info); Nif.NifStream(twistLowLimit.restitution, s, info); Nif.NifStream(twistLowLimit.spring, s, info); Nif.NifStream(twistLowLimit.damping, s, info); Nif.NifStream(twistHighLimit.value, s, info); Nif.NifStream(twistHighLimit.restitution, s, info); Nif.NifStream(twistHighLimit.spring, s, info); Nif.NifStream(twistHighLimit.damping, s, info); Nif.NifStream(xDrive.driveType, s, info); Nif.NifStream(xDrive.restitution, s, info); Nif.NifStream(xDrive.spring, s, info); Nif.NifStream(xDrive.damping, s, info); Nif.NifStream(yDrive.driveType, s, info); Nif.NifStream(yDrive.restitution, s, info); Nif.NifStream(yDrive.spring, s, info); Nif.NifStream(yDrive.damping, s, info); Nif.NifStream(zDrive.driveType, s, info); Nif.NifStream(zDrive.restitution, s, info); Nif.NifStream(zDrive.spring, s, info); Nif.NifStream(zDrive.damping, s, info); Nif.NifStream(swingDrive.driveType, s, info); Nif.NifStream(swingDrive.restitution, s, info); Nif.NifStream(swingDrive.spring, s, info); Nif.NifStream(swingDrive.damping, s, info); Nif.NifStream(twistDrive.driveType, s, info); Nif.NifStream(twistDrive.restitution, s, info); Nif.NifStream(twistDrive.spring, s, info); Nif.NifStream(twistDrive.damping, s, info); Nif.NifStream(slerpDrive.driveType, s, info); Nif.NifStream(slerpDrive.restitution, s, info); Nif.NifStream(slerpDrive.spring, s, info); Nif.NifStream(slerpDrive.damping, s, info); Nif.NifStream(drivePosition, s, info); Nif.NifStream(driveOrientation, s, info); Nif.NifStream(driveLinearVelocity, s, info); Nif.NifStream(driveAngularVelocity, s, info); Nif.NifStream(projectionMode, s, info); Nif.NifStream(projectionDistance, s, info); Nif.NifStream(projectionAngle, s, info); Nif.NifStream(gearRatio, s, info); Nif.NifStream(flags, s, info); }
public static void NifStream(Vector3 val, OStream s, NifInfo info) { WriteFloat(val.x, s); WriteFloat(val.y, s); WriteFloat(val.z, s); }
/*! NIFLIB_HIDDEN function. For internal use only. */ internal override void Write(OStream s, Dictionary <NiObject, uint> link_map, List <NiObject> missing_link_stack, NifInfo info) { base.Write(s, link_map, missing_link_stack, info); arraySize = (ushort)interpArrayItems.Count; if (info.version >= 0x0A010070) { Nif.NifStream(flags, s, info); } if (info.version <= 0x0A01006D) { Nif.NifStream(arraySize, s, info); Nif.NifStream(arrayGrowBy, s, info); } if (info.version >= 0x0A01006E) { Nif.NifStream((byte)arraySize, s, info); } if (info.version >= 0x0A010070) { Nif.NifStream(weightThreshold, s, info); if (((flags & 1) == 0)) { Nif.NifStream(interpCount, s, info); Nif.NifStream(singleIndex, s, info); Nif.NifStream(highPriority, s, info); Nif.NifStream(nextHighPriority, s, info); Nif.NifStream(singleTime, s, info); Nif.NifStream(highWeightsSum, s, info); Nif.NifStream(nextHighWeightsSum, s, info); Nif.NifStream(highEaseSpinner, s, info); for (var i3 = 0; i3 < interpArrayItems.Count; i3++) { WriteRef((NiObject)interpArrayItems[i3].interpolator, s, info, link_map, missing_link_stack); Nif.NifStream(interpArrayItems[i3].weight, s, info); Nif.NifStream(interpArrayItems[i3].normalizedWeight, s, info); if (info.version <= 0x0A01006D) { Nif.NifStream(interpArrayItems[i3].priority, s, info); } if (info.version >= 0x0A01006E) { Nif.NifStream((byte)interpArrayItems[i3].priority, s, info); } Nif.NifStream(interpArrayItems[i3].easeSpinner, s, info); } } } if (info.version <= 0x0A01006F) { for (var i2 = 0; i2 < interpArrayItems.Count; i2++) { WriteRef((NiObject)interpArrayItems[i2].interpolator, s, info, link_map, missing_link_stack); Nif.NifStream(interpArrayItems[i2].weight, s, info); Nif.NifStream(interpArrayItems[i2].normalizedWeight, s, info); if (info.version <= 0x0A01006D) { Nif.NifStream(interpArrayItems[i2].priority, s, info); } if (info.version >= 0x0A01006E) { Nif.NifStream((byte)interpArrayItems[i2].priority, s, info); } Nif.NifStream(interpArrayItems[i2].easeSpinner, s, info); } Nif.NifStream(managedControlled, s, info); Nif.NifStream((float)weightThreshold, s, info); Nif.NifStream(onlyUseHighestWeight, s, info); } if (info.version <= 0x0A01006D) { Nif.NifStream((ushort)interpCount, s, info); Nif.NifStream((ushort)singleIndex, s, info); } if ((info.version >= 0x0A01006E) && (info.version <= 0x0A01006F)) { Nif.NifStream((byte)interpCount, s, info); Nif.NifStream((byte)singleIndex, s, info); } if ((info.version >= 0x0A01006C) && (info.version <= 0x0A01006F)) { WriteRef((NiObject)singleInterpolator, s, info, link_map, missing_link_stack); Nif.NifStream((float)singleTime, s, info); } if (info.version <= 0x0A01006D) { Nif.NifStream((int)highPriority, s, info); Nif.NifStream((int)nextHighPriority, s, info); } if ((info.version >= 0x0A01006E) && (info.version <= 0x0A01006F)) { Nif.NifStream((byte)highPriority, s, info); Nif.NifStream((byte)nextHighPriority, s, info); } }
public static void NifStream(Float3 val, OStream s, NifInfo info) { WriteFloat(val.data[0], s); WriteFloat(val.data[1], s); WriteFloat(val.data[2], s); }
/*! NIFLIB_HIDDEN function. For internal use only. */ internal override void Write(OStream s, Dictionary <NiObject, uint> link_map, List <NiObject> missing_link_stack, NifInfo info) { base.Write(s, link_map, missing_link_stack, info); Nif.NifStream(typeOfControlledVariable, s, info); }
public static void NifStream(Color3 val, OStream s, NifInfo info) { WriteFloat(val.r, s); WriteFloat(val.g, s); WriteFloat(val.b, s); }
/*! NIFLIB_HIDDEN function. For internal use only. */ internal override void Write(OStream s, Dictionary <NiObject, uint> link_map, List <NiObject> missing_link_stack, NifInfo info) { base.Write(s, link_map, missing_link_stack, info); numChunks = (uint)chunks.Count; numBigTris = (uint)bigTris.Count; numBigVerts = (uint)bigVerts.Count; numTransforms = (uint)chunkTransforms.Count; numMaterials = (uint)chunkMaterials.Count; numMaterials8 = (uint)materials8.Count; numMaterials16 = (uint)materials16.Count; numMaterials32 = (uint)materials32.Count; Nif.NifStream(bitsPerIndex, s, info); Nif.NifStream(bitsPerWIndex, s, info); Nif.NifStream(maskWIndex, s, info); Nif.NifStream(maskIndex, s, info); Nif.NifStream(error, s, info); Nif.NifStream(boundsMin, s, info); Nif.NifStream(boundsMax, s, info); Nif.NifStream(weldingType, s, info); Nif.NifStream(materialType, s, info); Nif.NifStream(numMaterials32, s, info); for (var i3 = 0; i3 < materials32.Count; i3++) { Nif.NifStream(materials32[i3], s, info); } Nif.NifStream(numMaterials16, s, info); for (var i3 = 0; i3 < materials16.Count; i3++) { Nif.NifStream(materials16[i3], s, info); } Nif.NifStream(numMaterials8, s, info); for (var i3 = 0; i3 < materials8.Count; i3++) { Nif.NifStream(materials8[i3], s, info); } Nif.NifStream(numMaterials, s, info); for (var i3 = 0; i3 < chunkMaterials.Count; i3++) { Nif.NifStream(chunkMaterials[i3].material, s, info); if (info.version <= 0x14000005 && ((info.userVersion2 < 16))) { Nif.NifStream(chunkMaterials[i3].filter.layer_ob, s, info); } if (((info.version == 0x14020007) && (info.userVersion2 <= 34))) { Nif.NifStream(chunkMaterials[i3].filter.layer_fo, s, info); } if (((info.version == 0x14020007) && (info.userVersion2 > 34))) { Nif.NifStream(chunkMaterials[i3].filter.layer_sk, s, info); } Nif.NifStream(chunkMaterials[i3].filter.flagsAndPartNumber, s, info); Nif.NifStream(chunkMaterials[i3].filter.group, s, info); } Nif.NifStream(numNamedMaterials, s, info); Nif.NifStream(numTransforms, s, info); for (var i3 = 0; i3 < chunkTransforms.Count; i3++) { Nif.NifStream(chunkTransforms[i3].translation, s, info); Nif.NifStream(chunkTransforms[i3].rotation.x, s, info); Nif.NifStream(chunkTransforms[i3].rotation.y, s, info); Nif.NifStream(chunkTransforms[i3].rotation.z, s, info); Nif.NifStream(chunkTransforms[i3].rotation.w, s, info); } Nif.NifStream(numBigVerts, s, info); for (var i3 = 0; i3 < bigVerts.Count; i3++) { Nif.NifStream(bigVerts[i3], s, info); } Nif.NifStream(numBigTris, s, info); for (var i3 = 0; i3 < bigTris.Count; i3++) { Nif.NifStream(bigTris[i3].triangle1, s, info); Nif.NifStream(bigTris[i3].triangle2, s, info); Nif.NifStream(bigTris[i3].triangle3, s, info); Nif.NifStream(bigTris[i3].material, s, info); Nif.NifStream(bigTris[i3].weldingInfo, s, info); } Nif.NifStream(numChunks, s, info); for (var i3 = 0; i3 < chunks.Count; i3++) { chunks[i3].numWeldingInfo = (uint)chunks[i3].weldingInfo.Count; chunks[i3].numStrips = (uint)chunks[i3].strips.Count; chunks[i3].numIndices = (uint)chunks[i3].indices.Count; chunks[i3].numVertices = (uint)chunks[i3].vertices.Count; Nif.NifStream(chunks[i3].translation, s, info); Nif.NifStream(chunks[i3].materialIndex, s, info); Nif.NifStream(chunks[i3].reference, s, info); Nif.NifStream(chunks[i3].transformIndex, s, info); Nif.NifStream(chunks[i3].numVertices, s, info); for (var i4 = 0; i4 < chunks[i3].vertices.Count; i4++) { Nif.NifStream(chunks[i3].vertices[i4], s, info); } Nif.NifStream(chunks[i3].numIndices, s, info); for (var i4 = 0; i4 < chunks[i3].indices.Count; i4++) { Nif.NifStream(chunks[i3].indices[i4], s, info); } Nif.NifStream(chunks[i3].numStrips, s, info); for (var i4 = 0; i4 < chunks[i3].strips.Count; i4++) { Nif.NifStream(chunks[i3].strips[i4], s, info); } Nif.NifStream(chunks[i3].numWeldingInfo, s, info); for (var i4 = 0; i4 < chunks[i3].weldingInfo.Count; i4++) { Nif.NifStream(chunks[i3].weldingInfo[i4], s, info); } } Nif.NifStream(numConvexPieceA, s, info); }
public static void NifStream(HeaderString val, OStream s, NifInfo info) { s += (info.version <= VER_10_0_1_0 ? "NetImmerse File Format, Version " : "Gamebryo File Format, Version "); s += FormatVersionString(info.version); s += "\n"; }
/*! NIFLIB_HIDDEN function. For internal use only. */ internal override void Write(OStream s, Dictionary <NiObject, uint> link_map, List <NiObject> missing_link_stack, NifInfo info) { base.Write(s, link_map, missing_link_stack, info); Nif.NifStream(unknownShort, s, info); WriteRef((NiObject)data, s, info, link_map, missing_link_stack); }
public static void NifStream(LineString val, OStream s, NifInfo info) => s += val.line + "\n";
/*! NIFLIB_HIDDEN function. For internal use only. */ internal override void Write(OStream s, Dictionary <NiObject, uint> link_map, List <NiObject> missing_link_stack, NifInfo info) { base.Write(s, link_map, missing_link_stack, info); }
public static void WriteByte(byte val, OStream s) => s.Write(BitConverter.GetBytes(val), 0, 1);