DayZ 1.24
|
Private Member Functions | |
proto string | ToString (bool beautify=true) |
Vector to string. | |
proto float | Normalize () |
Normalizes vector. Returns length. | |
proto vector | Normalized () |
return normalized vector (keeps orginal vector untouched) | |
proto native float | Length () |
Returns length of vector (magnitude) | |
proto native float | LengthSq () |
Returns squared length (magnitudeSqr) | |
vector | Perpend () |
Returns perpendicular vector. Perpendicular vector is computed as cross product between input vector and up vector (0, 1, 0). | |
vector | GetRelAngles () |
Returns relative angles between -180 and 180, not 0 to 360. | |
proto float | VectorToYaw () |
Returns yaw of vector. | |
proto vector | VectorToAngles () |
Converts vector to spherical coordinates with radius = 1. | |
proto vector | AnglesToVector () |
Converts spherical coordinates (yaw, pitch, roll in degrees) to unit length vector. | |
proto void | RotationMatrixFromAngles (out vector mat[3]) |
Creates rotation matrix from angles. | |
proto vector | Multiply4 (vector mat[4]) |
Transforms position. | |
proto vector | Multiply3 (vector mat[3]) |
Transforms vector. | |
proto vector | InvMultiply4 (vector mat[4]) |
Invert-transforms position. | |
proto vector | InvMultiply3 (vector mat[3]) |
Invert-transforms vector. | |
Static Private Member Functions | |
static proto native float | Distance (vector v1, vector v2) |
Returns the distance between tips of two 3D vectors. | |
static proto native float | DistanceSq (vector v1, vector v2) |
Returns the square distance between tips of two 3D vectors. | |
static vector | Direction (vector p1, vector p2) |
Returns direction vector from point p1 to point p2. | |
static vector | RandomDir () |
Returns randomly generated unit vector. | |
static vector | RandomDir2D () |
Returns randomly generated XZ unit vector with the Y(up) axis set to 0. | |
static float | Dot (vector v1, vector v2) |
Returns Dot product of vector v1 and vector v2. | |
proto static native vector | YawToVector (float yaw) |
Returns vector of yaw. | |
static proto native vector | Lerp (vector v1, vector v2, float t) |
Lerp between two vectors. | |
static vector | RotateAroundZeroDeg (vector vec, vector axis, float angle) |
Rotate a vector around 0,0,0 by an angle in degrees. | |
static vector | RotateAroundZeroRad (vector vec, vector axis, float angle) |
Rotate a vector around 0,0,0 by an angle in radians. | |
static vector | RotateAroundZero (vector pos, vector axis, float cosAngle, float sinAngle) |
Rotate a vector around 0,0,0. | |
static vector | RotateAroundPoint (vector point, vector pos, vector axis, float cosAngle, float sinAngle) |
Rotate a vector around point. | |
static vector | ArrayToVec (float arr[]) |
Convert static array of floats into a vector. | |
Static Private Attributes | |
static const vector | Up = "0 1 0" |
static const vector | Aside = "1 0 0" |
static const vector | Forward = "0 0 1" |
static const vector | Zero = "0 0 0" |
Definition at line 105 of file EnConvert.c.
Converts spherical coordinates (yaw, pitch, roll in degrees) to unit length vector.
normalized
direction vector Convert static array of floats into a vector.
arr | vector in array format |
vector
resulting vector Definition at line 503 of file EnConvert.c.
References Vector().
Referenced by ArrowManagerPlayer::Load(), and ObjectSpawnerHandler::SpawnObject().
Returns direction vector from point p1 to point p2.
p1 | vector point from |
p2 | vector point to |
vector
direction vector Definition at line 220 of file EnConvert.c.
Referenced by EntityLightSource::AttachOnMemoryPoint(), CarScript(), WeaponParticlesBase::CheckOrientationOverride(), and UIScriptedMenu::Update().
Returns the distance between tips of two 3D vectors.
v1 | vector 3D Vector 1 |
v2 | vector 3D Vector 2 |
float
Distance Referenced by ActionFillBrakes::ActionCondition(), ActionFillCoolant::ActionCondition(), ActionFillOil::ActionCondition(), ActionCreateIndoorFireplace::ActionCondition(), ActionCreateIndoorOven::ActionCondition(), ActionPlaceFireplaceIndoor::ActionCondition(), ActionPlaceOvenIndoor::ActionCondition(), BotSelectNearestTarget(), Environment::CalcTemperatureFromTemperatureSource(), PluginBase::CalcTemperatureFromTemperatureSource(), PropertyModifiers::CalculateBarrelLength(), CalculateEyeAccoTarget(), CanReachSeatFromDoors(), DayZInfected::ChaseAttackLogic(), CheckAllowUpdate(), PoweredOptic_Base::DoMeasurement(), WeaponDebug::DrawLineOfFireCameraHybrid(), WeaponDebug::DrawLineOfFireMuzzleToHit(), UniversalTemperatureSourceLambdaBaseImpl::DryItemsInVicinity(), ContaminatedArea_Dynamic::EEOnCECreate(), InventoryItem::EOnContact(), EffBulletImpactBase::Event_OnStarted(), CGame::ExplosionEffects(), DayZInfected::FightAttackLogic(), GetCeilingHeight(), GetClosestCarWheel(), GetMeleeTargetEx(), GetMouseDistance(), ItemBase::GetNearestSlotIDByState(), Hologram::GetProjectionEntityPosition(), BaseBuildingBase::HasProperDistance(), HitZoneSelection(), AttachmentsOutOfReach::IsAttachmentReachable(), ComponentEnergyManager::IsEnergySourceAtReach(), IsObstructed(), ManBase::IsTargetInActiveRefresherRange(), Hit_MeatBones::OnEnterCalculations(), Grenade_Base::OnExplosionEffects(), Achievements::OnPlayerKilled(), AnalyticsManagerServer::OnPlayerToPlayerHit(), InventoryActionHandler::OnUpdate(), ActionPushCar::OnUpdate(), OnUpdate(), BotStateBase::OnUpdate(), PluginBase::PlayerHitBy(), PluginBase::PlayerKilled(), Environment::ProcessItemsDryness(), Pulling(), PluginRecipesManagerBase::RecipeSanityCheck(), Hud::RefreshPlayerTags(), ScriptConsoleVicinityTab::RenderList(), UIScriptedMenu::SetCameraData(), Hologram::SetHologramPosition(), DeveloperTeleport::TeleportAtCursor(), EntityLightSource::TryShadowOptimization(), UpdateDistanceWidget(), and PluginBase::UpdateStatWidget().
Returns the square distance between tips of two 3D vectors.
v1 | vector 3D Vector 1 |
v2 | vector 3D Vector 2 |
float
Squere distance Referenced by ActionFillBottleBase::ActionCondition(), ActionFillFuel::ActionCondition(), ActionEnterLadder::ActionCondition(), ActionTriggerRemotely::ActionCondition(), CCTCursor::Can(), CCTCursorNoObject::Can(), CCTCursorNoRuinCheck::Can(), CCTCursorParent::Can(), CCTMan::Can(), CCTNonRuined::Can(), CCTObject::Can(), CCTParent::Can(), CCTSurface::Can(), CCTTree::Can(), CCTWaterSurface::Can(), ActionTargets::ComputeUtility(), ComponentEnergyManager::DebugUpdate(), ActionTargets::DistSqrPoint2Line(), ActionRepackTentCB::DropDuringRepacking(), ContaminatedArea_Dynamic::EEOnCECreate(), EvaluateComponentEx(), DayZInfected::FightLogic(), FilterObstructedObjectsByGrouping(), Environment::GatherTemperatureSources(), GetClosestDoor(), GetClosestSafePos(), GetMeleeTargetEx(), EntityAI::GetNearestDoorBySoundPos(), ActionTargetsCursor::GetOnScreenPosition(), Hologram::GetProjectionEntityPosition(), HitZoneSelectionRaycast(), IsInReach(), IsObjectObstructedEx(), IsPlaceable(), ItemBase::IsPlaceable(), IsShortDistance(), WeaponStateBase::OnAbort(), OnAbort(), RemoteDetonatorTrigger::OnActivatedByItem(), OnCEUpdate(), RemoteDetonatorTrigger::OnCEUpdate(), ActionEmptyMagazine::OnExecuteServer(), WeaponStateBase::OnExit(), Grenade_Base::OnExplosionEffects(), CGame::OnRPC(), FliesMdfr::OnTick(), PluginBase::ProcessUniversalTemperatureSources(), RefreshFireplaceVisuals(), VicinityItemManager::RefreshVicinityItems(), ResizeParticle(), FlareSimulation::Simulate(), SplitArrayIntoGroupsByDistance(), ManBase::SpreadAgentsEx(), TargetSelection(), and AreaDamageTriggerBase::UpdateInsiders().
Returns Dot product of vector v1 and vector v2.
v1 | vector input vector |
v2 | vector input vector |
vector
direction vector Definition at line 271 of file EnConvert.c.
Referenced by ActionCreateIndoorFireplace::ActionCondition(), ActionCreateIndoorOven::ActionCondition(), ActionPlaceFireplaceIndoor::ActionCondition(), ActionPlaceOvenIndoor::ActionCondition(), CanBeIgnitedBy(), CheckContactCache(), DayZInfected::ComputeHitDirectionAngle(), DayZCreatureAI::ComputeHitDirectionAngleDeg(), DayZInfected::ComputeHitDirectionAngleEx(), ActionTargets::DistSqrPoint2Line(), DropAllItemsInInventoryInBounds(), DayZInfected::EvaluateCrawlTransitionAnimation(), DayZPlayer::EvaluateDamageHitAnimation(), DayZPlayer::EvaluateDeathAnimation(), EffBulletImpactBase::Event_OnStarted(), VicinityItemManager::ExcludeFromContainer_Phase1(), FilterObstructedObjectsByGrouping(), ActionPushCar::GetDirectionDot(), HitZoneSelectionRaycast(), IsEntityBehindEntityInAngle(), BaseBuildingBase::IsFacingCamera(), BaseBuildingBase::IsFacingPlayer(), IsPlayerOrientedTowardPos(), Weapon::LiftWeaponCheck(), OnAttachmentRuined(), OnContact(), RotateAroundZero(), RotateAroundZeroDeg(), and RotateAroundZeroRad().
|
inlineprivate |
Returns relative angles between -180 and 180, not 0 to 360.
float
Relative angles Definition at line 286 of file EnConvert.c.
Invert-transforms position.
mat | vector [4] transformation matrix |
vec | vector position to transform |
vector
transformed position Returns length of vector (magnitude)
float
Length of vector Referenced by Hologram::AlignProjectionOnTerrain(), CheckContactCache(), EffBulletImpactBase::EvaluateEffect(), EffBulletImpactBase::Event_OnStarted(), Hit_MeatBones::Event_OnStarted(), Entity::RegisterTransportHit(), and ScriptConsoleGeneralTab::Update().
Transforms position.
mat | vector [4] transformation matrix |
vec | vector position to transform |
vector
transformed position Normalizes vector. Returns length.
float
Length of origin vector Referenced by CreateArrow(), CreateBridgeArrow(), ComponentEnergyManager::DrawArrow(), WeaponDebug::DrawLineOfFireCameraHybrid(), MeleeTargetSettings(), CGame::OnProjectileStoppedInObject(), CGame::OnProjectileStoppedInTerrain(), and PluginBase::OnUpdate().
return normalized vector (keeps orginal vector untouched)
Referenced by CarScript(), CheckContactCache(), EffBulletImpactBase::Event_OnStarted(), GetHeadingVector(), Math3D::GetRandomDir(), OnContact(), EntityPlacementCallback::OnSetup(), RandomDir(), RandomDir2D(), and DayZIntroSceneXbox::UpdateCharacterPos().
|
inlineprivate |
Returns perpendicular vector. Perpendicular vector is computed as cross product between input vector and up vector (0, 1, 0).
vector
perpendicular vector Definition at line 209 of file EnConvert.c.
References Up.
Referenced by CreateArrow(), CreateBridgeArrow(), and ComponentEnergyManager::DrawArrow().
Returns randomly generated unit vector.
randomly
generated unit vector Definition at line 243 of file EnConvert.c.
References Normalized(), Math::RandomFloatInclusive(), and Vector().
Returns randomly generated XZ unit vector with the Y(up) axis set to 0.
randomly
generated XZ unit vector Definition at line 260 of file EnConvert.c.
References Normalized(), Math::RandomFloatInclusive(), and Vector().
Referenced by SpookyEventBase::GetSoundPos(), and ContaminatedArea_Dynamic::SpawnItems().
|
inlinestaticprivate |
Rotate a vector around point.
point | point to rotate around |
pos | vector to rotate |
axis | axis to rotate around |
cosAngle | cos of angle |
sinAngle | sin of angle |
vector
transformed vector Definition at line 492 of file EnConvert.c.
References RotateAroundZero().
|
inlinestaticprivate |
Rotate a vector around 0,0,0.
pos | vector to rotate |
axis | axis to rotate around |
cosAngle | cos of angle |
sinAngle | sin of angle |
vector
transformed vector Definition at line 478 of file EnConvert.c.
References Dot().
Referenced by FilterObstructedObjectsByGrouping(), EffectArea::PlaceParticles(), RotateAroundPoint(), and GameInventory::SetGroundPosByOwnerBounds().
|
inlinestaticprivate |
Rotate a vector around 0,0,0 by an angle in degrees.
vec | vector to rotate |
axis | axis to rotate around |
cosAngle | angle in degrees |
vector
transformed vector Definition at line 451 of file EnConvert.c.
References Math::Cos(), Math::DEG2RAD, Dot(), and Math::Sin().
Referenced by Weapon::LiftWeaponCheck().
|
inlinestaticprivate |
Rotate a vector around 0,0,0 by an angle in radians.
vec | vector to rotate |
axis | axis to rotate around |
cosAngle | angle in radians |
vector
transformed vector Definition at line 464 of file EnConvert.c.
References Math::Cos(), Dot(), and Math::Sin().
Creates rotation matrix from angles.
ang | vector which contains angles | |
[out] | mat | vector created rotation matrix |
Vector to string.
beautify | If true verbose vector in more human readable form "<1, 1, 1>" instead of simple form "1 1 1" |
string
Converted vector as parsed string Referenced by RecoilBase::ApplyMouseOffset(), PluginBase::CheckInit(), PluginBase::GetPlayerPrefix(), PluginConfigHandler::SetItemDebugPos(), UIScriptedMenu::SetPosition(), and HudDebugWinBase::Update().
Converts vector to spherical coordinates with radius = 1.
vector
spherical coordinates (yaw, pitch, roll in degrees) Referenced by ActionEnterLadder::ActionCondition(), and EffBulletImpactBase::Event_OnStarted().
Returns vector of yaw.
yaw | float Value of yaw |
vector
Yaw converted in vector Referenced by RecoilBase::PostInit().
Definition at line 108 of file EnConvert.c.
Referenced by FilterObstructedObjectsByGrouping().
Definition at line 109 of file EnConvert.c.
Referenced by ActionBuryBody::Can(), ActionDigInStash::Can(), Can(), ActionDigWorms::Can(), DayZPlayerImplementThrowing::CheckFreeSpace(), DropAllItemsInInventoryInBounds(), and OnAttachmentRuined().
Definition at line 107 of file EnConvert.c.
Referenced by CanBeIgnitedBy(), DayZSpectator::EOnFrame(), FilterObstructedObjectsByGrouping(), FloatingCrossHair(), EntityAI::IsAreaAtDoorFree(), Weapon::LiftWeaponCheck(), ImprovisedExplosive::OnPlacementComplete(), Perpend(), EffectArea::PlaceParticles(), and GameInventory::SetGroundPosByOwnerBounds().
Definition at line 110 of file EnConvert.c.
Referenced by AddLightSource(), AreaDamageManager(), AreaDamageTriggerBase::AreaDamageTrigger(), ATCCachedObject::ATCCachedTarget(), CCTSurface::Can(), CCTWaterSurface::Can(), SpookyEventBase::CanPerform(), ActionManagerClient::CanPerformActionFromInventory(), ActionManagerClient::CanPerformActionFromQuickbar(), ActionManagerClient::CanSetActionFromInventory(), ManBase::CommandHandler(), CopyOldPropertiesToNew(), Particle::CreateParticleEffect(), Weapon::CreateWeaponWithAmmo(), DeployableContainer_Base(), EOnPostSimulate(), ExplosivesBase(), ActionManagerClient::FindActionTarget(), CGame::FirearmEffects(), FireplaceBase(), ActionManagerClient::ForceTarget(), GameplayEffectsData::GenerateSequenceRandomPosition(), DayZInfected::GetAttackPitch(), GetCurrentLocalPosition(), EffectSound::GetCurrentLocalPosition(), ScriptConsoleGeneralTab::GetCurrentLocationPos(), EffectParticle::GetCurrentOrientation(), GetCurrentPosition(), Entity::GetDefaultHitPosition(), GetDefaultHitPosition(), Hologram::GetDefaultOrientation(), GetHeadingVector(), AITargetCallbacks::GetHeadPositionWS(), SpookyEventBase::GetMatchingSurfacePos(), GetMemoryPointPosition(), ActionTargetsCursor::GetOnScreenPosition(), Hologram::GetProjectionEntityPosition(), Hologram::GetProjectionOrientation(), Hologram::GetProjectionPosition(), AreaDamageComponentRaycasted::GetRaycastedHitZone(), GetValveAligningPointsWS(), Selection::GetVertexPosition(), AITargetCallbacks::GetVisionPointPositionWS(), Container_Base::GiftBox_Base(), UIScriptedMenu::HandleLights(), UIScriptedMenu::HandleNVG(), HandleReciveData(), ActionWorldCraft::HandleReciveData(), FirearmActionAttachMagazine::HandleReciveData(), FirearmActionAttachMagazineQuick::HandleReciveData(), HitZoneSelectionRaycast(), Init(), InternalResetTarget(), ATCCachedObject::Invalidate(), Weapon::LiftWeaponCheck(), PluginConfigHandler::LoadScenePlayer(), Math3D::MatrixIdentity4(), OnActivate(), OnCenterPanelDropReceived(), BotWaitForChangeInHands::OnEntry(), CGame::OnEvent(), ActionCreateIndoorFireplace::OnExecuteServer(), ActionCreateIndoorOven::OnExecuteServer(), OnInit(), DayZPlayer::OnInputUserDataProcess(), ManBase::OnParticleEvent(), Trigger::OnRPC(), CGame::OnRPC(), DayZPlayerCameraBase::OnUpdate(), OnUpdate(), ActionManagerClient::PerformActionFromInventory(), ActionManagerClient::PerformActionFromQuickbar(), ManBase::PhysicalPredictiveDropItem(), EffectArea::PlaceParticles(), ManBase::PlacingCancelLocal(), ManBase::PlacingCancelServer(), ManBase::PlacingCompleteLocal(), ManBase::PlacingCompleteServer(), ContaminatedArea_Dynamic::PlayFX(), PlaySmokeParticle(), SEffectManager::PlaySoundOnObject(), FirearmActionAttachMagazineQuick::Post_SetupAction(), ManBase::PredictiveForceSwapEntities(), ManBase::PredictiveSwapEntities(), ManBase::PredictiveTakeEntityToHands(), ReadFromContext(), ManBase::ReloadWeapon(), RemoveLightSource(), InventoryActionHandler::SetAction(), ActionManagerClient::SetActionFromInventory(), DeveloperTeleport::SetPlayerPosition(), ActionFishingNew::SetupAction(), SetupAction(), PluginBase::SpawnItemOnCrosshair(), UndergroundTriggerCarrierBase::SpawnTrigger(), StandUp(), ItemBase::TentBase(), TestOwnership(), PMTPlayback::TestStopping(), TrySelectFinisherType(), ScriptedWidgetEventHandler::Update(), ActionManagerServer::Update(), CarHornShortActionInput::UpdatePossibleActions(), ToggleLightsActionInput::UpdatePossibleActions(), ToggleNVGActionInput::UpdatePossibleActions(), WeaponParticlesBase::WeaponParticlesBase(), and WriteToContext().