#### Topic: The shade - is owed by object or a lamp?

There is 3D an object, and a lamp. They . And still there is a shade. The shade should know about object that , but she also should know about a light source, where it and what characteristics at it. Where it is better to thrust a shade on design? In object? But whereas to anchor a lamp? In a lamp? But then the lamp should know about all objects. A question not in how to make. And in that as on beauty from the point of view of OOP.

#### Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: SO> Where it is better to thrust a shade on design? SO> a question not in how to make. And in that as on beauty from the point of view of OOP. To thrust in object on which the shade falls. He should learn the nobility about a lamp and objects on light way.

#### Re: The shade - is owed by object or a lamp?

Hello, neFormal, you wrote: F> to thrust in object on which the shade falls. He should learn the nobility about a lamp and objects on light way. Too much cross  links. It is possible certainly for bluntly all objects to throw the pointer on a scene, and the scene knows all. But somehow it is not beautiful.  it is possible more beautifully?

#### Re: The shade - is owed by object or a lamp?

Hello, neFormal, you wrote: F> to thrust in object on which the shade falls. He should learn the nobility about a lamp and objects on light way. There can be some objects accepting a shade from one. And on the contrary, on one object other objects can  shades some. And still the object can  a shade on itself, if it nonconvex.

#### Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: SO> There is 3D an object, and a lamp. They . And still there is a shade. SO> the shade should know about object that , but she also should know about a light source, where it and what characteristics at it. SO> where it is better to thrust a shade on design? In object? But whereas to anchor a lamp? In a lamp? But then the lamp should know about all objects. In a scene (or in object specially trained for this purpose) which knows both about a lamp, and about object.

#### Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: SO> There is 3D an object, and a lamp. They . And still there is a shade. SO> the shade should know about object that , but she also should know about a light source, where it and what characteristics at it. SO> where it is better to thrust a shade on design? In object? But whereas to anchor a lamp? In a lamp? But then the lamp should know about all objects. SO> a question not in how to make. And in that as on beauty from the point of view of OOP. And it here is necessary ? Generally on idea it not a shade , and the third object illuminated by a lamp.

#### Re: The shade - is owed by object or a lamp?

Hello, V. Zudin, you wrote: SVZ> In a scene (or in object specially trained for this purpose) which knows both about a lamp, and about object. This first decision which occurs. It would be desirable to hear sentences,  who of that non-standard offers.

#### Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: SO> This first decision which occurs. It would be desirable to hear sentences,  who of that non-standard offers. What for to you non-standard? Generally light sources, objects  a shade and objects accepting a shade can move from a frame to a frame. If at you each object contains collections of all light sources, all objects which  on it a shade, and-or all objects which accept from it a shade in each frame it is necessary to update these collections.

#### Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: SO> There is 3D an object, and a lamp. They . And still there is a shade. SO> the shade should know about object that , but she also should know about a light source, where it and what characteristics at it. SO> where it is better to thrust a shade on design? In object? But whereas to anchor a lamp? In a lamp? But then the lamp should know about all objects. SO> a question not in how to make. And in that as on beauty from the point of view of OOP. From the point of view of beauty of OOP you have a scene with several light sources. The scene knows both about a lamp and about a subject on paths of light and about a subject on which light falls.

#### Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: SO> the Question not in how to make. And in that as on beauty from the point of view of OOP. In  the specific approaches: https://en.wikipedia.org/wiki/Entity%E2 … 0%93system There not on the first place, the main thing of 60 times and it is more for second all to fulfill OOP (and if it is necessary - to a shade to disconnect).

#### Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: SO> the Question not in how to make. And in that as on beauty from the point of view of OOP. There is there no OOP and it is not necessary there. All correctly write about a scene. The lamp and object are a data, something passive, they are processed by a scene.

#### Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: F>> to thrust in object on which the shade falls. He should learn the nobility about a lamp and objects on light way. SO> too much cross  links. It is possible certainly for bluntly all objects to throw the pointer on a scene, and the scene knows all. But somehow it is not beautiful.  it is possible more beautifully? For each point it is necessary to know a level of its shadowing. If the point too is object in sense of OOP it is necessary to know by whom it is closed from a light source and what reflexes receives. Receive it it can from a scene environmental it. Basically, each object can estimate area which it covers with a shade and  on this array of points any event. A pier, "enumerate lighting". It is possible to do it even through the bus of messages.

#### Re: The shade - is owed by object or a lamp?

Hello, Qbit86, you wrote: F>> to thrust in object on which the shade falls. He should learn the nobility about a lamp and objects on light way. Q> there can be some objects accepting a shade from one. Therefore each object itself looks, by whom it is closed from light Q> And on the contrary, on one object other objects can  shades some. Each object finds all closing it from light sources objects Q> And still the object can  a shade on itself, if it nonconvex. With it already more difficult and here operation is transferred to points

#### Re: The shade - is owed by object or a lamp?

Hello, Vladek, you wrote: V> In  the specific approaches: https://en.wikipedia.org/wiki/Entity%E2 … 0%93system V> There not on the first place, the main thing of 60 times and it is more for second all to fulfill OOP (and if it is necessary - to a shade to disconnect). Entity-Component-System it is the specific approach, it is possible to tell an architectural pattern and it at all does not contradict OOP. OOP is necessary not for inheritance-encapsulation-polymorphism, and for control of complexity of the decision. I.e. decision structurization. As soon as you solved the task, it needs to be translated in the code. Here also starts to work as OOP. And Entity-Component-System it is already specific variant of design. Actually in  the cleanest OOP got accustomed - objects consist of objects, interact with other objects by means of messages and . An interaction Special case - control as becomes by means of messages. From here it is clear that methods are anchored to the object or not anchored it for OOP business the tenth, strangely enough. That is, takeDamege (entity) and entity.takeDamege () are absolutely equivalent.

#### Re: The shade - is owed by object or a lamp?

I> Actually in  the cleanest OOP got accustomed - objects consist of objects, interact with other objects by means of messages and . An interaction Special case - control as becomes by means of messages. I> from here it is clear that methods are anchored to the object or not anchored it for OOP business the tenth, strangely enough. That is, takeDamege (entity) and entity.takeDamege () are absolutely equivalent. On all remaining yes, and here by an example - is not present (or overpersuade, please) For me OOP it in the core not about  objects and how they exchange, and that "the code near to given", i.e. actually "data" is not present, is all "is incapsulated". And here between takeDamege (entity) and entity.takeDamege () a difference . I do not want to tell that takeDamege (entity) it badly, simply difference is, and if in mine  "to accept damages" is "in the nature" the object (instead of simply private scenario  with it) I will prefer entity.takeDamege ()

#### Re: The shade - is owed by object or a lamp?

Hello, ylem, you wrote: I>> From here it is clear that methods are anchored to the object or not anchored it for OOP business the tenth, strangely enough. That is, takeDamege (entity) and entity.takeDamege () are absolutely equivalent. Y> on all remaining yes, and here by an example - is not present (or overpersuade, please) Y> For me OOP it in the core not about  objects and how they exchange, and that "the code near to given", i.e. actually "data" is not present, is all "is incapsulated". Y> And here between takeDamege (entity) and entity.takeDamege () a difference . I do not want to tell that takeDamege (entity) it badly, simply difference is, and if in mine  "to accept damages" is "in the nature" the object (instead of simply private scenario  with it) I will prefer entity.takeDamege () and if "in the nature" the object there is a possibility to change "health" f-tsija takeDamage (entity) will do entity.decreaseHp (n), and f-tsija heal (entity) will do entity.increaseHp (n)

#### Re: The shade - is owed by object or a lamp?

F> and if "in the nature" the object there is a possibility to change "health" f-tsija takeDamage (entity) will do entity.decreaseHp (n), and f-tsija heal (entity) will do entity.increaseHp (n) And besides, I would prefer not to change health outside so explicitly because, for example, at any  generally there is no health in the usual sense or somebody treat-nelechi, all .

#### Re: The shade - is owed by object or a lamp?

Hello, Ikemefula, you wrote: I> Hello, Vladek, you wrote: V>> In  the specific approaches: https://en.wikipedia.org/wiki/Entity%E2 … 0%93system V>> There not on the first place, the main thing of 60 times and it is more for second all to fulfill OOP (and if it is necessary - to a shade to disconnect). I> Entity-Component-System it is the specific approach, it is possible to tell an architectural pattern and it at all does not contradict OOP. I> OOP is necessary not for inheritance-encapsulation-polymorphism, and for control of complexity of the decision. I.e. decision structurization. I> as soon as you solved the task, it needs to be translated in the code. Here also starts to work as OOP. And Entity-Component-System it is already specific variant of design. I> actually in  the cleanest OOP got accustomed - objects consist of objects, interact with other objects by means of messages and . An interaction Special case - control as becomes by means of messages. It is implementation of game business logic, and we about  speak.

#### Re: The shade - is owed by object or a lamp?

Hello, ylem, you wrote: F>> and if "in the nature" the object there is a possibility to change "health" f-tsija takeDamage (entity) will do entity.decreaseHp (n), and f-tsija heal (entity) will do entity.increaseHp (n) Y> And besides, I would prefer not to change health outside so explicitly because, for example, at any  generally there is no health in the usual sense or somebody treat-nelechi, all . It already depends on the approach. Nothing hinders to make empty implementation of a method. And if there also entity component system with HealthComponent only inc/dec also remain.

#### Re: The shade - is owed by object or a lamp?

F> nothing hinders to make empty implementation of a method. And if there also entity component system with HealthComponent only inc/dec also remain. All the same went to read about ECS. Thanks.