Example #1
0
CASource * CGmResMan::NewASource( CABuffer * poABuffer )
{
	CASource * poASource = 0;
	if( poABuffer )
	{
		poASource = new CASource;
		if( poASource->Init() )
		{
			poASource->SetBuffer( poABuffer );
			poASource->SetAmp( 1.0f );
			poASource->SetPos( TVec() );
			poASource->SetDir( TVec() ); // non-directional
			poASource->SetVel( TVec() );
			poASource->SetPitch( 1.0f );
			poASource->SetLooping( false );
			poASource->SetAmpMin( 0.0f );
			poASource->SetAmpMax( 1.0f );
			//poASource->SetMaxDist( MAX_FLOAT );
			poASource->SetMaxDist( 800.0f );
			poASource->SetRolloffFactor( 1.0f );
			poASource->SetConeOuterAmp( 0.0f );
			poASource->SetConeInnerAngle( 50.0f );
			poASource->SetConeOuterAngle( 120.0f );
			poASource->SetReferenceDist( 7.0f );
			poASource->SetSourceRelative( false );
			
			m_oArrASource.Append( poASource );
		}
		else
		{
			DELETE_INSTANCE( poASource );
		}
	}
	return poASource;
}
Example #2
0
void CGSprite::Orient( const TVec &roNormal )
{
	CMatrix4x4 oM;
	oM.Orient( roNormal );

	m_aoPos[0] = oM * TVec( - m_fSize, - m_fSize, 0.0f );
	m_aoPos[1] = oM * TVec( + m_fSize, - m_fSize, 0.0f );
	m_aoPos[2] = oM * TVec( + m_fSize, + m_fSize, 0.0f );
	m_aoPos[3] = oM * TVec( - m_fSize, + m_fSize, 0.0f );
	
	//Init();
	//for( unsigned int i=0; i<4; ++i )
	//	m_aoPos[i] = m_aoPos[i];
	
	/*
	const float fAng = m_oNormal.Angle( roNormal );
	const TVec oOrg( 0.0f, 0.0f, 0.0f );
	const TVec oAx( m_oNormal * roNormal ); //oOrg.CalcNormal( m_oNormal, roNormal );
	//for( unsigned int i=0; i<4; ++i )
	//	m_aoPos[i].Rotate( oAx, fAng );
	m_aoPos[0].Rotate( oAx, fAng );
	m_aoPos[1].Rotate( oAx, fAng );
	m_aoPos[2].Rotate( oAx, fAng );
	m_aoPos[3].Rotate( oAx, fAng );
	*/

	m_oNormal = roNormal;
}
Example #3
0
CCurveBezier3::CCurveBezier3()
: CCurve()
, m_uiRes( 23 )
{
	for( unsigned int i=0; i<4; ++i )
	{
		m_aoVertex[i].m_uiVertex = i;
	}
	m_aoVertex[0].m_oColor.Set( float( rand() ) / RAND_MAX, float( rand() ) / RAND_MAX, float( rand() ) / RAND_MAX );
	m_aoVertex[3].m_oColor.Set( float( rand() ) / RAND_MAX, float( rand() ) / RAND_MAX, float( rand() ) / RAND_MAX );
	m_aoVertex[0].m_oColor.Dot( TVec( 1.4f, 1.4f, 1.4f ) );
	m_aoVertex[3].m_oColor.Dot( TVec( 1.4f, 1.4f, 1.4f ) );
	m_aoVertex[0].m_oColor.Clamp();
	m_aoVertex[3].m_oColor.Clamp();
}
Example #4
0
IMPLEMENT_FUNCTION(VBasePlayer, ClearPlayer)
{
    P_GET_SELF;

    Self->PClass = 0;
    Self->ForwardMove = 0;
    Self->SideMove = 0;
    Self->FlyMove = 0;
    Self->Buttons = 0;
    Self->Impulse = 0;
    Self->MO = NULL;
    Self->PlayerState = 0;
    Self->ViewOrg = TVec(0, 0, 0);
    Self->PlayerFlags &= ~VBasePlayer::PF_FixAngle;
    Self->Health = 0;
    Self->PlayerFlags &= ~VBasePlayer::PF_AttackDown;
    Self->PlayerFlags &= ~VBasePlayer::PF_UseDown;
    Self->PlayerFlags &= ~VBasePlayer::PF_AutomapRevealed;
    Self->PlayerFlags &= ~VBasePlayer::PF_AutomapShowThings;
    Self->ExtraLight = 0;
    Self->FixedColourmap = 0;
    Self->CShift = 0;
    Self->PSpriteSY = 0;

    vuint8* Def = Self->GetClass()->Defaults;
    for (VField* F = Self->GetClass()->Fields; F; F = F->Next)
    {
        VField::CopyFieldValue(Def + F->Ofs, (vuint8*)Self + F->Ofs, F->Type);
    }
}
Example #5
0
void VBasePlayer::DoClientStartSound(int SoundId, TVec Org, int OriginId,
                                     int Channel, float Volume, float Attenuation, bool Loop)
{
#ifdef CLIENT
    guard(VBasePlayer::DoClientStartSound);
    GAudio->PlaySound(SoundId, Org, TVec(0, 0, 0), OriginId, Channel, Volume,
                      Attenuation, Loop);
    unguard;
#endif
}
Example #6
0
CCurve::TVec CCurveCatmullRom3::ProcColor( float fP ) const // tmp
{
	UNUSED_PARAMETER( fP );
	return TVec( 1.0f, 1.0f, 1.0f, 1.0f );
	/*
	const unsigned int i = (unsigned int)( fP );
	const unsigned int uiMax = m_oArrVertex.GetSize() - 2;
	if( i >= uiMax ) // opt
		return m_oArrVertex[uiMax].m_oColor;
	const float t = fP - i;
	return m_oArrVertex[i+1].m_oColor * ( 1.0f - t ) + m_oArrVertex[i+2].m_oColor * fP;
	*/
}
Example #7
0
void VLevelInfo::SectorStartSequence(const sector_t* Sector, VName Name,
	int ModeNum)
{
	guard(VLevelInfo::SectorStartSequence);
	if (Sector)
	{
		if (Sector->SectorFlags & sector_t::SF_Silent)
		{
			return;
		}
		StartSoundSequence(Sector->soundorg, (Sector - XLevel->Sectors) +
			(SNDORG_Sector << 24), Name, ModeNum);
	}
	else
	{
		StartSoundSequence(TVec(0, 0, 0), 0, Name, ModeNum);
	}
	unguard;
}
Example #8
0
void VLevelInfo::SectorStartSound(const sector_t* Sector, int SoundId,
	int Channel, float Volume, float Attenuation)
{
	guard(VLevelInfo::SectorStartSound);
	if (Sector)
	{
		if (Sector->SectorFlags & sector_t::SF_Silent)
		{
			return;
		}
		StartSound(Sector->soundorg, (Sector - XLevel->Sectors) +
			(SNDORG_Sector << 24), SoundId, Channel, Volume, Attenuation,
			false);
	}
	else
	{
		StartSound(TVec(0, 0, 0), 0, SoundId, Channel, Volume,
			Attenuation, false);
	}
	unguard;
}