MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / Load

Method Load

engine/Poseidon/AI/VehicleAI.cpp:156–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154static const float MarkerWhiteBrightness = 0.001;
155
156void ReflectorInfo::Load(EntityAIType& type, const ParamEntry& cls, float armor)
157{
158 LODShape* shape = type.GetShape();
159 color = GetColor(cls >> "color");
160 colorAmbient = GetColor(cls >> "ambient");
161 positionIndex = -1;
162 directionIndex = -1;
163 position = VZero;
164 direction = VForward;
165 Shape* memory = shape->MemoryLevel();
166 if (memory)
167 {
168 RString name = cls >> "position";
169 positionIndex = memory->PointIndex(name);
170 if (positionIndex >= 0)
171 {
172 position = memory->Pos(positionIndex);
173 }
174 name = cls >> "direction";
175 directionIndex = memory->PointIndex(name);
176 if (directionIndex >= 0 && positionIndex >= 0)
177 {
178 direction = memory->Pos(directionIndex) - position;
179 direction.Normalize();
180 }
181 }
182 size = cls >> "size";
183 brightness = cls >> "brightness";
184 RString selName = cls >> "selection";
185 selection.Init(shape, selName, nullptr);
186 RString hitName = cls >> "hitpoint";
187 hitPoint = HitPoint(shape->HitpointsLevel(), hitName, nullptr, armor, -1);
188 hitPoint.SetIndex(type.GetHitPoints().Add(&hitPoint));
189};
190
191int MuzzleNameCachedMagazineSlots::IdxOfMuzzle(const RString& muzzle) const
192{

Callers 1

InitShapeMethod · 0.45

Calls 15

HitPointClass · 0.85
saturateMaxFunction · 0.85
saturateMinFunction · 0.85
GlobLoadTextureFunction · 0.85
GetPictureNameFunction · 0.85
logFunction · 0.85
GetValueFunction · 0.85
MemoryLevelMethod · 0.80
PointIndexMethod · 0.80
PosMethod · 0.80
HitpointsLevelMethod · 0.80
GetColorFunction · 0.50

Tested by

no test coverage detected