| 154 | static const float MarkerWhiteBrightness = 0.001; |
| 155 | |
| 156 | void 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 | |
| 191 | int MuzzleNameCachedMagazineSlots::IdxOfMuzzle(const RString& muzzle) const |
| 192 | { |
no test coverage detected