Updated xphyspreset
This commit is contained in:
parent
3b65f1bdf2
commit
eebd333e11
@ -2,16 +2,14 @@
|
|||||||
|
|
||||||
XPhysPreset::XPhysPreset()
|
XPhysPreset::XPhysPreset()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mNamePtr(0)
|
, mName()
|
||||||
, mName("")
|
|
||||||
, mType(0)
|
, mType(0)
|
||||||
, mMass(0)
|
, mMass(0)
|
||||||
, mBounce(0)
|
, mBounce(0)
|
||||||
, mFriction(0)
|
, mFriction(0)
|
||||||
, mBulletForceScale(0)
|
, mBulletForceScale(0)
|
||||||
, mExplosiveForceScale(0)
|
, mExplosiveForceScale(0)
|
||||||
, mSndAliasPrefixPtr(0)
|
, mSndAliasPrefix()
|
||||||
, mSndAliasPrefix("")
|
|
||||||
, mPiecesSpreadFraction(0)
|
, mPiecesSpreadFraction(0)
|
||||||
, mPiecesUpwardVelocity(0)
|
, mPiecesUpwardVelocity(0)
|
||||||
, mTempDefaultToCylinder(false)
|
, mTempDefaultToCylinder(false)
|
||||||
@ -27,21 +25,40 @@ XPhysPreset::~XPhysPreset()
|
|||||||
|
|
||||||
void XPhysPreset::ParseData(QDataStream *aStream)
|
void XPhysPreset::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr() == -1)
|
||||||
|
{
|
||||||
|
mName.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mType
|
||||||
|
>> mMass
|
||||||
|
>> mBounce
|
||||||
|
>> mFriction
|
||||||
|
>> mBulletForceScale
|
||||||
|
>> mExplosiveForceScale;
|
||||||
|
|
||||||
|
mSndAliasPrefix.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
*aStream
|
||||||
|
>> mPiecesSpreadFraction
|
||||||
|
>> mPiecesUpwardVelocity
|
||||||
|
>> mTempDefaultToCylinder;
|
||||||
|
|
||||||
|
mName.ParseData(aStream);
|
||||||
|
mSndAliasPrefix.ParseData(aStream);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XPhysPreset::Clear()
|
void XPhysPreset::Clear()
|
||||||
{
|
{
|
||||||
mNamePtr = 0;
|
mName.Clear();
|
||||||
mName.clear();
|
|
||||||
mType = 0;
|
mType = 0;
|
||||||
mMass = 0;
|
mMass = 0;
|
||||||
mBounce = 0;
|
mBounce = 0;
|
||||||
mFriction = 0;
|
mFriction = 0;
|
||||||
mBulletForceScale = 0;
|
mBulletForceScale = 0;
|
||||||
mExplosiveForceScale = 0;
|
mExplosiveForceScale = 0;
|
||||||
mSndAliasPrefixPtr = 0;
|
mSndAliasPrefix.Clear();
|
||||||
mSndAliasPrefix.clear();
|
|
||||||
mPiecesSpreadFraction = 0;
|
mPiecesSpreadFraction = 0;
|
||||||
mPiecesUpwardVelocity = 0;
|
mPiecesUpwardVelocity = 0;
|
||||||
mTempDefaultToCylinder = false;
|
mTempDefaultToCylinder = false;
|
||||||
|
|||||||
@ -2,36 +2,28 @@
|
|||||||
#define XPHYSPRESET_H
|
#define XPHYSPRESET_H
|
||||||
|
|
||||||
#include "xasset.h"
|
#include "xasset.h"
|
||||||
|
#include "xstring.h"
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
class XPhysPreset : public XAsset
|
class XPhysPreset : public XAsset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
XPhysPreset();
|
explicit XPhysPreset();
|
||||||
~XPhysPreset();
|
~XPhysPreset();
|
||||||
|
|
||||||
virtual void ParseData(QDataStream* aStream) override;
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
qint32 mNamePtr;
|
XString mName;
|
||||||
QString mName;
|
|
||||||
|
|
||||||
int mType;
|
int mType;
|
||||||
|
|
||||||
float mMass;
|
float mMass;
|
||||||
float mBounce;
|
float mBounce;
|
||||||
float mFriction;
|
float mFriction;
|
||||||
float mBulletForceScale;
|
float mBulletForceScale;
|
||||||
float mExplosiveForceScale;
|
float mExplosiveForceScale;
|
||||||
|
XString mSndAliasPrefix;
|
||||||
qint32 mSndAliasPrefixPtr;
|
|
||||||
QString mSndAliasPrefix;
|
|
||||||
|
|
||||||
float mPiecesSpreadFraction;
|
float mPiecesSpreadFraction;
|
||||||
float mPiecesUpwardVelocity;
|
float mPiecesUpwardVelocity;
|
||||||
|
|
||||||
bool mTempDefaultToCylinder;
|
bool mTempDefaultToCylinder;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user