コード例 #1
0
void HeightMapFlatSegment::getHeightAndNormal(float x, float y, float& height, WFMath::Vector<3>& normal) const
{
  height = mHeight;
  normal.x() = 0;
  normal.y() = 0;
  normal.z() = 1;
}
コード例 #2
0
ファイル: SoundService.cpp プロジェクト: sajty/ember
void SoundService::updateListenerPosition(const WFMath::Point<3>& pos, const WFMath::Vector<3>& direction, const WFMath::Vector<3>& up)
{
	if (!isEnabled()) {
		return;
	}

	alListener3f(AL_POSITION, pos.x(), pos.y(), pos.z());
	SoundGeneral::checkAlError("Setting the listener position.");

	//Set the direction of the listener.

	ALfloat aluVectors[6];
	aluVectors[0] = direction.x();
	aluVectors[1] = direction.y();
	aluVectors[2] = direction.z();
	aluVectors[3] = up.x();
	aluVectors[4] = up.y();
	aluVectors[5] = up.z();

	alListenerfv(AL_ORIENTATION, aluVectors);
	SoundGeneral::checkAlError("Setting the listener orientation.");
}
コード例 #3
0
void Steering::moveToPoint(const WFMath::Point<3>& point)
{

	auto entity3dPosition = mAvatar.getEntity()->getViewPosition();
	WFMath::Vector<3> vel = point - entity3dPosition;

	WFMath::Quaternion orientation;
	if (vel != WFMath::Vector<3>::ZERO()) {
		orientation.rotation(WFMath::Vector<3>(0, 0, 1), WFMath::Vector<3>(vel).normalize(), WFMath::Vector<3>(0, 1, 0));
	}

	mAvatar.moveToPoint(point, orientation);

	mLastSentVelocity = WFMath::Vector<2>(vel.x(), vel.z());
	mExpectingServerMovement = true;
}
コード例 #4
0
ファイル: SoundSource.cpp プロジェクト: Arsakes/ember
void SoundSource::setVelocity(const WFMath::Vector<3>& vel)
{
	assert(vel.isValid());
	alSource3f(mALSource, AL_VELOCITY, vel.x(), vel.y(), vel.z());
	SoundGeneral::checkAlError("Setting sound source velocity.");
}