PMXLoaderScript.CastIntRead(System.IO.BinaryReader, PMXFormat.Header.IndexSize)

Here are the examples of the csharp api class PMXLoaderScript.CastIntRead(System.IO.BinaryReader, PMXFormat.Header.IndexSize) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

19 Examples 7

1. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.BoneWeight ReadBoneWeightBDEF1() {
		PMXFormat.BDEF1 result = new PMXFormat.BDEF1();
		result.bone1_ref = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		return result;
	}

2. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.BoneWeight ReadBoneWeightBDEF2() {
		PMXFormat.BDEF2 result = new PMXFormat.BDEF2();
		result.bone1_ref = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		result.bone2_ref = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		result.bone1_weight = binary_reader_.ReadSingle();
		return result;
	}

3. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.FaceVertexList ReadFaceVertexList() {
		PMXFormat.FaceVertexList result = new PMXFormat.FaceVertexList();
		uint face_vert_count = binary_reader_.ReadUInt32();
		result.face_vert_index = new uint[face_vert_count];
		for (uint i = 0, i_max = (uint)result.face_vert_index.Length; i < i_max; ++i) {
			result.face_vert_index[i] = CastIntRead(binary_reader_, format_.header.vertexIndexSize);
		}
		return result;
	}

4. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.MorphOffset ReadUVMorphOffset() {
		PMXFormat.UVMorphOffset result = new PMXFormat.UVMorphOffset();
		result.vertex_index = CastIntRead(binary_reader_, format_.header.vertexIndexSize);
		result.uv_offset = ReadSinglesToVector4(binary_reader_);
		return result;
	}

5. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.BoneWeight ReadBoneWeightQDEF() {
		PMXFormat.BDEF4 result = new PMXFormat.BDEF4();
		result.bone1_ref = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		result.bone2_ref = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		result.bone3_ref = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		result.bone4_ref = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		result.bone1_weight = binary_reader_.ReadSingle();
		result.bone2_weight = binary_reader_.ReadSingle();
		result.bone3_weight = binary_reader_.ReadSingle();
		result.bone4_weight = binary_reader_.ReadSingle();
		return result;
	}

6. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.MorphOffset ReadVertexMorphOffset() {
		PMXFormat.VertexMorphOffset result = new PMXFormat.VertexMorphOffset();
		result.vertex_index = CastIntRead(binary_reader_, format_.header.vertexIndexSize);
		result.position_offset = ReadSinglesToVector3(binary_reader_);
		return result;
	}

7. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.BoneWeight ReadBoneWeightBDEF4() {
		PMXFormat.BDEF4 result = new PMXFormat.BDEF4();
		result.bone1_ref = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		result.bone2_ref = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		result.bone3_ref = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		result.bone4_ref = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		result.bone1_weight = binary_reader_.ReadSingle();
		result.bone2_weight = binary_reader_.ReadSingle();
		result.bone3_weight = binary_reader_.ReadSingle();
		result.bone4_weight = binary_reader_.ReadSingle();
		return result;
	}

8. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.MorphOffset ReadGroupMorphOffset() {
		PMXFormat.GroupMorphOffset result = new PMXFormat.GroupMorphOffset();
		result.morph_index = CastIntRead(binary_reader_, format_.header.morphIndexSize);
		result.morph_rate = binary_reader_.ReadSingle();
		return result;
	}

9. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.DisplayElement ReadDisplayElement() {
		PMXFormat.DisplayElement result = new PMXFormat.DisplayElement();
		result.element_target = binary_reader_.ReadByte();
		PMXFormat.Header.IndexSize element_target_index_size = ((result.element_target == 0) ? format_.header.boneIndexSize : format_.header.morphIndexSize);
		result.element_target_index = CastIntRead(binary_reader_, element_target_index_size);
		return result;
	}

10. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.MorphOffset ReadImpulseMorphOffset() {
		PMXFormat.ImpulseMorphOffset result = new PMXFormat.ImpulseMorphOffset();
		result.rigidbody_index = CastIntRead(binary_reader_, format_.header.morphIndexSize);
		result.local_flag = binary_reader_.ReadByte();
		result.move_velocity = ReadSinglesToVector3(binary_reader_);
		result.rotation_torque = ReadSinglesToVector3(binary_reader_);
		return result;
	}

11. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.IK_Link ReadIkLink() {
		PMXFormat.IK_Link result = new PMXFormat.IK_Link();
		result.target_bone_index = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		result.angle_limit = binary_reader_.ReadByte();
		if (result.angle_limit == 1) {
			result.lower_limit = ReadSinglesToVector3(binary_reader_);
			result.upper_limit = ReadSinglesToVector3(binary_reader_);
		}
		return result;
	}

12. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.BoneWeight ReadBoneWeightSDEF() {
		PMXFormat.SDEF result = new PMXFormat.SDEF();
		result.bone1_ref = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		result.bone2_ref = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		result.bone1_weight = binary_reader_.ReadSingle();
		result.c_value = ReadSinglesToVector3(binary_reader_);
		result.r0_value = ReadSinglesToVector3(binary_reader_);
		result.r1_value = ReadSinglesToVector3(binary_reader_);
		return result;
	}

13. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.MorphOffset ReadBoneMorphOffset() {
		PMXFormat.BoneMorphOffset result = new PMXFormat.BoneMorphOffset();
		result.bone_index = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		result.move_value = ReadSinglesToVector3(binary_reader_);
		result.rotate_value = ReadSinglesToQuaternion(binary_reader_);
		return result;
	}

14. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.IK_Data ReadIkData() {
		PMXFormat.IK_Data result = new PMXFormat.IK_Data();
		result.ik_bone_index = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		result.iterations = binary_reader_.ReadUInt32();
		result.limit_angle = binary_reader_.ReadSingle();
		uint ik_link_count = binary_reader_.ReadUInt32();
		result.ik_link = new PMXFormat.IK_Link[ik_link_count];
		for (uint i = 0, i_max = (uint)result.ik_link.Length; i < i_max; ++i) {
			result.ik_link[i] = ReadIkLink();
		}
		return result;
	}

15. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.Joint ReadJoint() {
		PMXFormat.Joint result = new PMXFormat.Joint();
		result.name = ReadString();
		result.english_name = ReadString();
		result.operation_type = (PMXFormat.Joint.OperationType)binary_reader_.ReadByte();
		switch (result.operation_type) {
		case PMXFormat.Joint.OperationType.Spring6DOF:
			result.rigidbody_a = CastIntRead(binary_reader_, format_.header.rigidbodyIndexSize);
			result.rigidbody_b = CastIntRead(binary_reader_, format_.header.rigidbodyIndexSize);
			result.position = ReadSinglesToVector3(binary_reader_);
			result.rotation = ReadSinglesToVector3(binary_reader_);
			result.constrain_pos_lower = ReadSinglesToVector3(binary_reader_);
			result.constrain_pos_upper = ReadSinglesToVector3(binary_reader_);
			result.constrain_rot_lower = ReadSinglesToVector3(binary_reader_);
			result.constrain_rot_upper = ReadSinglesToVector3(binary_reader_);
			result.spring_position = ReadSinglesToVector3(binary_reader_);
			result.spring_rotation = ReadSinglesToVector3(binary_reader_);
			break;
		default:
			//empty.
			break;
		}
		return result;
	}

16. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.MorphOffset ReadMaterialMorphOffset() {
		PMXFormat.MaterialMorphOffset result = new PMXFormat.MaterialMorphOffset();
		result.material_index = CastIntRead(binary_reader_, format_.header.materialIndexSize);
		result.offset_method = (PMXFormat.MaterialMorphOffset.OffsetMethod)binary_reader_.ReadByte();
		result.diffuse = ReadSinglesToColor(binary_reader_);
		result.specular = ReadSinglesToColor(binary_reader_, 1);
		result.specularity = binary_reader_.ReadSingle();
		result.ambient = ReadSinglesToColor(binary_reader_, 1);
		result.edge_color = ReadSinglesToColor(binary_reader_);
		result.edge_size = binary_reader_.ReadSingle();
		result.texture_coefficient = ReadSinglesToColor(binary_reader_);
		result.sphere_texture_coefficient = ReadSinglesToColor(binary_reader_);
		result.toon_texture_coefficient = ReadSinglesToColor(binary_reader_);
		return result;
	}

17. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.Rigidbody ReadRigidbody() {
		PMXFormat.Rigidbody result = new PMXFormat.Rigidbody();
		result.name = ReadString();
		result.english_name = ReadString();
		result.rel_bone_index = CastIntRead(binary_reader_, format_.header.boneIndexSize);
		result.group_index = binary_reader_.ReadByte();
		result.ignore_collision_group = binary_reader_.ReadUInt16();
		result.shape_type = (PMXFormat.Rigidbody.ShapeType)binary_reader_.ReadByte();
		result.shape_size = ReadSinglesToVector3(binary_reader_);
		result.collider_position = ReadSinglesToVector3(binary_reader_);
		result.collider_rotation = ReadSinglesToVector3(binary_reader_);
		result.weight = binary_reader_.ReadSingle();
		result.position_dim = binary_reader_.ReadSingle();
		result.rotation_dim = binary_reader_.ReadSingle();
		result.recoil = binary_reader_.ReadSingle();
		result.friction = binary_reader_.ReadSingle();
		result.operation_type = (PMXFormat.Rigidbody.OperationType)binary_reader_.ReadByte();
		return result;
	}

18. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.Material ReadMaterial() {
		PMXFormat.Material result = new PMXFormat.Material();
		result.name = ReadString();
		result.english_name = ReadString();
		result.diffuse_color = ReadSinglesToColor(binary_reader_); // dr, dg, db, da // ???
		result.specular_color = ReadSinglesToColor(binary_reader_, 1); // sr, sg, sb // ???
		result.specularity = binary_reader_.ReadSingle();
		result.ambient_color = ReadSinglesToColor(binary_reader_, 1); // mr, mg, mb // ???(ambient)
		result.flag = (PMXFormat.Material.Flag)binary_reader_.ReadByte();
		result.edge_color = ReadSinglesToColor(binary_reader_); // r, g, b, a
		result.edge_size = binary_reader_.ReadSingle();
		result.usually_texture_index = CastIntRead(binary_reader_, format_.header.textureIndexSize);
		result.sphere_texture_index = CastIntRead(binary_reader_, format_.header.textureIndexSize);
		result.sphere_mode = (PMXFormat.Material.SphereMode)binary_reader_.ReadByte();
		result.common_toon = binary_reader_.ReadByte();
		PMXFormat.Header.IndexSize texture_index_size = ((result.common_toon == 0)? format_.header.textureIndexSize: PMXFormat.Header.IndexSize.Byte1);
		result.toon_texture_index = CastIntRead(binary_reader_, texture_index_size);
		result.memo = ReadString();
		result.face_vert_count = binary_reader_.ReadUInt32(); // ???? // ?????????????????0??????
		return result;
	}

19. Example

Project: mmd-for-unity
Source File: PMXLoaderScript.cs
View license
private PMXFormat.Bone ReadBone() {
		PMXFormat.Bone result = new PMXFormat.Bone();
		result.bone_na/n ..... /n //View Source file for more details /n }