当前位置: 首页>>代码示例>>C++>>正文


C++ LLDataPacker::packU8方法代码示例

本文整理汇总了C++中LLDataPacker::packU8方法的典型用法代码示例。如果您正苦于以下问题:C++ LLDataPacker::packU8方法的具体用法?C++ LLDataPacker::packU8怎么用?C++ LLDataPacker::packU8使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLDataPacker的用法示例。


在下文中一共展示了LLDataPacker::packU8方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: pack

BOOL LLPartSysData::pack(LLDataPacker &dp)
{
	dp.packU32(mCRC, "pscrc");
	dp.packU32(mFlags, "psflags");
	dp.packU8(mPattern, "pspattern");
	dp.packFixed(mMaxAge, "psmaxage", FALSE, 8, 8);
	dp.packFixed(mStartAge, "psstartage", FALSE, 8, 8);
	dp.packFixed(mInnerAngle, "psinnerangle", FALSE, 3, 5);
	dp.packFixed(mOuterAngle, "psouterangle", FALSE, 3, 5);
	dp.packFixed(mBurstRate, "psburstrate", FALSE, 8, 8);
	dp.packFixed(mBurstRadius, "psburstradius", FALSE, 8, 8);
	dp.packFixed(mBurstSpeedMin, "psburstspeedmin", FALSE, 8, 8);
	dp.packFixed(mBurstSpeedMax, "psburstspeedmax", FALSE, 8, 8);
	dp.packU8(mBurstPartCount, "psburstpartcount");

	dp.packFixed(mAngularVelocity.mV[0], "psangvelx", TRUE, 8, 7);
	dp.packFixed(mAngularVelocity.mV[1], "psangvely", TRUE, 8, 7);
	dp.packFixed(mAngularVelocity.mV[2], "psangvelz", TRUE, 8, 7);

	dp.packFixed(mPartAccel.mV[0], "psaccelx", TRUE, 8, 7);
	dp.packFixed(mPartAccel.mV[1], "psaccely", TRUE, 8, 7);
	dp.packFixed(mPartAccel.mV[2], "psaccelz", TRUE, 8, 7);

	dp.packUUID(mPartImageID, "psuuid");
	dp.packUUID(mTargetUUID, "pstargetuuid");
	mPartData.pack(dp);
	return TRUE;
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:28,代码来源:llpartdata.cpp

示例2: packProfileParams

bool LLVolumeMessage::packProfileParams(
	const LLProfileParams* params,
	LLDataPacker &dp)
{
	// Default to cylinder
	static LLProfileParams defaultparams(LL_PCODE_PROFILE_CIRCLE, U16(0), U16(0), U16(0));
	
	if (!params)
		params = &defaultparams;
	
	U8 tempU8;
	U16 tempU16;
	
	tempU8 = params->getCurveType();
	dp.packU8(tempU8, "Curve");

	tempU16 = (U16) ll_round( params->getBegin() / CUT_QUANTA);
	dp.packU16(tempU16, "Begin");

	tempU16 = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA);
	dp.packU16(tempU16, "End");

	tempU16 = (U16) ll_round(params->getHollow() / HOLLOW_QUANTA);
	dp.packU16(tempU16, "Hollow");
	return true;
}
开发者ID:Belxjander,项目名称:Kirito,代码行数:26,代码来源:llvolumemessage.cpp

示例3: serialize

BOOL LLMultiGesture::serialize(LLDataPacker& dp) const
{
	dp.packS32(GESTURE_VERSION, "version");
	dp.packU8(mKey, "key");
	dp.packU32(mMask, "mask");
	dp.packString(mTrigger, "trigger");
	dp.packString(mReplaceText, "replace");

	S32 count = (S32)mSteps.size();
	dp.packS32(count, "step_count");
	S32 i;
	for (i = 0; i < count; ++i)
	{
		LLGestureStep* step = mSteps[i];

		dp.packS32(step->getType(), "step_type");
		BOOL ok = step->serialize(dp);
		if (!ok)
		{
			return FALSE;
		}
	}
	return TRUE;
}
开发者ID:HizWylder,项目名称:GIS,代码行数:24,代码来源:llmultigesture.cpp

示例4: packPathParams

bool LLVolumeMessage::packPathParams(
	const LLPathParams* params,
	LLDataPacker &dp)
{
	// Default to cylinder with no cut, top same size as bottom, no shear, no twist
	static LLPathParams defaultparams(LL_PCODE_PATH_LINE, U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), U8(0), 0);
	if (!params)
		params = &defaultparams;
	
	U8 curve = params->getCurveType();
	dp.packU8(curve, "Curve");

	U16 begin = (U16) ll_round(params->getBegin() / CUT_QUANTA);
	dp.packU16(begin, "Begin");

	U16 end = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA);
	dp.packU16(end, "End");

	// Avoid truncation problem with direct F32->U8 cast.
	// (e.g., (U8) (0.50 / 0.01) = (U8) 49.9999999 = 49 not 50.

	U8 pack_scale_x = 200 - (U8) ll_round(params->getScaleX() / SCALE_QUANTA);
	dp.packU8(pack_scale_x, "ScaleX");

	U8 pack_scale_y = 200 - (U8) ll_round(params->getScaleY() / SCALE_QUANTA);
	dp.packU8(pack_scale_y, "ScaleY");

	S8 pack_shear_x = (S8) ll_round(params->getShearX() / SHEAR_QUANTA);
	dp.packU8(*(U8 *)&pack_shear_x, "ShearX");

	S8 pack_shear_y = (S8) ll_round(params->getShearY() / SHEAR_QUANTA);
	dp.packU8(*(U8 *)&pack_shear_y, "ShearY");

	S8 twist = (S8) ll_round(params->getTwist() / SCALE_QUANTA);
	dp.packU8(*(U8 *)&twist, "Twist");
	
	S8 twist_begin = (S8) ll_round(params->getTwistBegin() / SCALE_QUANTA);
	dp.packU8(*(U8 *)&twist_begin, "TwistBegin");

	S8 radius_offset = (S8) ll_round(params->getRadiusOffset() / SCALE_QUANTA);
	dp.packU8(*(U8 *)&radius_offset, "RadiusOffset");

	S8 taper_x = (S8) ll_round(params->getTaperX() / TAPER_QUANTA);
	dp.packU8(*(U8 *)&taper_x, "TaperX");

	S8 taper_y = (S8) ll_round(params->getTaperY() / TAPER_QUANTA);
	dp.packU8(*(U8 *)&taper_y, "TaperY");

	U8 revolutions = (U8) ll_round( (params->getRevolutions() - 1.0f) / REV_QUANTA);
	dp.packU8(*(U8 *)&revolutions, "Revolutions");

	S8 skew = (S8) ll_round(params->getSkew() / SCALE_QUANTA);
	dp.packU8(*(U8 *)&skew, "Skew");

	return true;
}
开发者ID:Belxjander,项目名称:Kirito,代码行数:56,代码来源:llvolumemessage.cpp

示例5: serialize


//.........这里部分代码省略.........

			LLQuaternion inRot = mayaQ( ki->mRot[0], ki->mRot[1], ki->mRot[2], order);

			LLQuaternion outRot =  frameRotInv* mergeChildRot * inRot * mergeParentRot * ~first_frame_rot * frameRot * offsetRot;

			U16 time_short = F32_to_U16(time, 0.f, mDuration);
			dp.packU16(time_short, "time");
			U16 x, y, z;
			LLVector3 rot_vec = outRot.packToVector3();
			rot_vec.quantize16(-1.f, 1.f, -1.f, 1.f);
			x = F32_to_U16(rot_vec.mV[VX], -1.f, 1.f);
			y = F32_to_U16(rot_vec.mV[VY], -1.f, 1.f);
			z = F32_to_U16(rot_vec.mV[VZ], -1.f, 1.f);
			dp.packU16(x, "rot_angle_x");
			dp.packU16(y, "rot_angle_y");
			dp.packU16(z, "rot_angle_z");
			outcount++;
			frame++;
		}
		
		// output position keys (only for 1st joint)
		if ( ji == mJoints.begin() && !joint->mIgnorePositions )
		{
			dp.packS32(joint->mNumPosKeys, "num_pos_keys");

			LLVector3 relPos = joint->mRelativePosition;
			LLVector3 relKey;

			frame = 1;
			for (	ki = joint->mKeys.begin();
					ki != joint->mKeys.end();
					++ki )
			{
				if ((frame == 1) && joint->mRelativePositionKey)
				{
					relKey.setVec(ki->mPos);
				}

				if (ki->mIgnorePos)
				{
					frame++;
					continue;
				}

				time = (F32)frame * mFrameTime;

				LLVector3 inPos = (LLVector3(ki->mPos) - relKey) * ~first_frame_rot;// * fixup_rot;
				LLVector3 outPos = inPos * frameRot * offsetRot;

				outPos *= INCHES_TO_METERS;

				outPos -= relPos;
				outPos.clamp(-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);

				U16 time_short = F32_to_U16(time, 0.f, mDuration);
				dp.packU16(time_short, "time");

				U16 x, y, z;
				outPos.quantize16(-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET, -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
				x = F32_to_U16(outPos.mV[VX], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
				y = F32_to_U16(outPos.mV[VY], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
				z = F32_to_U16(outPos.mV[VZ], -LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);
				dp.packU16(x, "pos_x");
				dp.packU16(y, "pos_y");
				dp.packU16(z, "pos_z");

				frame++;
			}
		}
		else
		{
			dp.packS32(0, "num_pos_keys");
		}
	}

	S32 num_constraints = (S32)mConstraints.size();
	dp.packS32(num_constraints, "num_constraints");

	for (ConstraintVector::iterator constraint_it = mConstraints.begin();
		constraint_it != mConstraints.end();
		constraint_it++)
		{
			U8 byte = constraint_it->mChainLength;
			dp.packU8(byte, "chain_lenght");
			
			byte = constraint_it->mConstraintType;
			dp.packU8(byte, "constraint_type");
			dp.packBinaryDataFixed((U8*)constraint_it->mSourceJointName, 16, "source_volume");
			dp.packVector3(constraint_it->mSourceOffset, "source_offset");
			dp.packBinaryDataFixed((U8*)constraint_it->mTargetJointName, 16, "target_volume");
			dp.packVector3(constraint_it->mTargetOffset, "target_offset");
			dp.packVector3(constraint_it->mTargetDir, "target_dir");
			dp.packF32(constraint_it->mEaseInStart,	"ease_in_start");
			dp.packF32(constraint_it->mEaseInStop,	"ease_in_stop");
			dp.packF32(constraint_it->mEaseOutStart,	"ease_out_start");
			dp.packF32(constraint_it->mEaseOutStop,	"ease_out_stop");
		}

	return TRUE;
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:101,代码来源:llbvhloader.cpp

示例6: packParams

void LLTransferSourceParamsFile::packParams(LLDataPacker &dp) const
{
	dp.packString(mFilename, "Filename");
	dp.packU8((U8)mDeleteOnCompletion, "Delete");
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:5,代码来源:lltransfersourcefile.cpp


注:本文中的LLDataPacker::packU8方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。