Ejemplo n.º 1
0
void DataOutputStream::writeVec3Array(const osg::Vec3Array* a)
{
    int size = a->size();
    writeInt(size);
    for(int i = 0; i < size; i++){
        writeVec3((*a)[i]);
    }

    if (_verboseOutput) std::cout<<"read/writeVec3Array() ["<<size<<"]"<<std::endl;
}
void EntityTemplateInterpreter::generateTestByteCode() {
	std::ofstream out("autoGenerated.tpl", std::ofstream::binary);

    writeByte(0xB0, out);
    writeByte(0x01, out);writeString("size", out);
    writeByte(0x02, out);writeString("testFloat", out);
    writeByte(0x03, out);writeString("testString", out);
    writeByte(0x04, out);writeString("I AM SUCH A STRING", out);
    writeByte(0x05, out);writeString("testInt", out);
    writeByte(0x06, out);writeString("ball.png", out);
    writeByte(0x07, out);writeString("fancy", out);

    writeByte(0xB1, out);

    writeVec2(glm::vec2(100,100), out);                 //Size
    writeByte(0x01, out);
    writeFloat(33.544f, out);                           //testFloat
    writeByte(0x02, out);
    writeByte(0xD5, out);writeByte(0x04, out);               //testString
    writeByte(0x03, out);
    writeVec3(glm::vec3(349,43,435), out);                                     //testInt
    writeByte(0x05, out);

    writeByte(0xB2, out);

    writeByte(0xC0, out);               //TextureComponent
    writeByte(0xD5, out); writeByte(0x06, out);
    writeUint16(5, out);
    writeUint16(1, out);
    writeUint16(3, out);
    writeUint16(1, out);

    writeByte(0xC1, out);               //ScriptComponent
    writeByte(0xD5, out); writeByte(0x07, out);

	writeByte(0xC2, out);               //MoveComponent
	writeFloat(20.f, out);	//Acc
	writeFloat(4.f, out);	//Damping
	writeFloat(20.f, out);	//Mass
	writeFloat(4.f, out);	//Deacc

	writeByte(0xC3, out);               //CollisionComponent
	writeUint16(1, out);	//Box Count
	writeFloat(20.f, out);	//x
	writeFloat(4.f, out);	//y
	writeFloat(20.f, out);	//w
	writeFloat(4.f, out);	//h
	writeByte(0xD5, out); writeByte(0xA7, out);	//Trigger Name
}
Ejemplo n.º 3
0
void writeScale(CborEncoder *enc, Scale scale)
{
    writeVec3(enc, scale);
}
Ejemplo n.º 4
0
void writePosition(CborEncoder *enc, Position position)
{
    writeVec3(enc, position);
}