unit – Rotate the object always at the same speed on the screen, regardless of the distance from the camera?

I spin a globe like the hologlobe of XCOM,

enter description of image here

I rotate it using Quaternion.RotateTowards (Quaternion from, Quaternion to, float maxDegreesDelta).

I found good value for money for maxDegreesDelta, in my case it is 5.0f.

There is a limit on the distance or the distance at which the camera can be, suppose that closed is 1.0f and it is far 2.0f.

I want to be able to zoom in on the globe, but obviously when I do, it turns a little too fast.

When zoomed out, the rotation speed is satisfactory:

enter description of image here

When zoomed in, rotation is too fast, making manipulation more difficult:

enter description of image here

And the problem becomes even more evident as the size of the game view increases, that is, in full screen.

Using Mathf.Lerp and Mathf.InverseLerp, I tried to do maxDegreesDelta and the mouse delta proportional to the distance from the camera, but that is hardly convincing.

Note: I rotate the globe, not the camera.


How can I make sure that the object rotates at the same speed on the screen, regardless of the distance or the distance from the camera?

magento2 – A type error occurred while creating the object: Magento Framework Interception Config Config after upgrading to 2.3.2?

After running the update from 2.2.8 to 2.3.2, I get this error every time I run a CLI command like upgrading or cleaning the cache:

main.CRITICAL: A type error occurred while creating the object: Magento Framework Interception Config Config, the return value of Magento Framework Interception Config CacheManager: : load () must be of array type or null, the returned string () ()

Any idea how to fix this?

Thank you!

c # – Problem when using ThenInclude in object collection

I have the following code for a query

var level= _context.leveis
                .Include(lev=> lev.idLevel2Navigation)
                    .ThenInclude(lev=> lev.idLevel3Navigation)
                        .ThenInclude(lev=> lev.idLevel4Navigation)
                .Where(lev=> lev.IdLevel== id)

I want to have this return for each object in the table

    "IdLevel": 1,
    "idLevel2Navigation": (
         "IdLevel": 2,
         "idLevel3Navigation": (
            "IdLevel": 3,
            "idLevel4Navigation": (
                "IdLevel": 4,
                "idLevel5Navigation": (


However, only this opening of levels works for the first object. The other objects only go to inclusion.

object orientation – How to create a recursive association in PHP POO or in Portuguese

Thank you for contributing to Stack Overflow in Portuguese!

  • Make answer the question. Get into the details of your solution and share what you've discovered.

But to avoid

  • Ask for clarification or details on other responses.
  • Make statements based solely on your opinion; occasional references or previous experiences.

For more information, see our tips for writing correct answers.

dnd 5th – Do the Expert Magical Object of an Artificer and the Magical Device of Use of a Multiclass Thief Thief allow them to benefit from a Covenant Keeper's Wand?

L & # 39; Artificer Magic Item Scientist indicates the following:

At the 14th level, your skill with magic objects deepens further:
• You can set up to five magic items at a time.
• You ignore all class, race, spell and level requirements when adapting or using a magic item.

The thief thief Use Magic Device indicates the following:

At the 13th level, you have learned enough about how magic works to be able to improvise the use of objects even if they are not intended for you. You ignore all the class, race and level requirements on the use of magic items.

Rod of the Pact Keeper states the following:

While holding this cane, you gain a +1 bonus to spell attack rolls and saving throw DCs for your warlock spells.

Additionally, you can recover a warlock spell slot as an action while holding the rod. You can no longer use this property until you have completed a long rest.

Since these features allow an Artificer or Multiclassed Thief to ignore the "class" requirements when using a Covenant Keeper's Wand, would they ignore all instances of "Warlock" in the text and would benefit from the general bonus for casting spell attack rolls and recording casting DCs and being able to regain a spell location?

Related questions:
1. What requirements does the Artificers Magic Item Savant feature ignore?
2. Do the Knowledgeable Magical Object of an Artificer and the Magical Device of Use of a Thief Thief allow them to benefit from the aura of 30 feet from a Saint Avenger?

unit – why does Physics.Raycast always return my player game object instead of the object I clicked on?

I have the 3D world. I want to detect when the player clicks on a game object in the world.

this image

In this image, I have 2 objects on which I want to detect a mouse click. The white sphere has a collider. The dumpster does not work. The behavior is the same as that shown below.

I detect the mouse. When I check the RaycastHit, I always have the transformation of the player's game object and not the game object I clicked on in the world. If I delete the raycaster checks, I get a mouse for everything in the game, not just the mouse on the game object. I need to be able to distinguish clicks on different game objects.

I found an article here and added a PhysicsRayCaster, but that didn't change the behavior. The problem is not to get the event. My problem is to detect the game object that the player clicked in the world.

Here is my code:

public class InventoryItemSearchHandler : MonoBehaviour
    private void Update()
        if (Input.GetMouseButtonDown(0))
            Ray ray = UnityEngine.Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;

            if (Physics.Raycast(ray, out hit))
                // CompareTo always fails because hit.transform.name is always "Player" and
                // not the name of the object clicked on
                if (0 == hit.transform.name.CompareTo(transform.name))
                    print("mouse down");

In the image below (compared to the one above), I get the correct transformation in the RaycastHit type when I click on the white sphere (and when I click on the dumpster, I & Get the drive transformation as shown above).

enter description of image here
So it looks like the player object is getting in the way. What would be the cause of this?

In domain-driven design, is a timestamp a property or object of value?

I have certain entities and certain valuables that must record the time when they were created. Now, I read that a valuable object is a collection of properties with its own set of rules, and two valuable objects with the same properties are indistinguishable.

Now I'm probably going to use the standard C # DateTime data type for this, and I'm not sure how it is implemented internally (maybe just a Unix timestamp, which as a primitive should be a property, but s & They have a solution to the problem of the year 2038 which involves several properties in relation to each other, it would be more complicated).

I think what makes the difference is that even if a timestamp has its own set of rules (for example, "January 35" is not a valid date), I will not apply these rules; the language itself will do it. The date is always created internally; I never analyze anything submitted by the user in a date.

So I lean toward a timestamp being a property. But I started to think: can I apply this rule to all type of data whose rules are defined outside of my application? For example, an image file. I am not in charge of having it structured correctly according to the JPEG specification; language will do that. I could have restrictions on the size of the file, but in the same way, an entity could have restrictions on the length of one of its strings and I do not see that this is turned into something of value for this right, although I could be wrong.

And if there is a set of tailor-made rules for one type of data, for example an invoice, that the company I work with has already been located elsewhere and that I import as library? This could be as complicated a data type as possible.

So, consistently:

  • Is a timestamp a valuable item or a property of one?
  • What makes the difference between valuables and properties? Is this a locally defined set of rules, or is it something else?

And even more concretely; I choose between these two models (which, I believe, must correspond more or less directly with my current code):

Version 1:

version 1

Version 2:

version 2

How do I access a protected property in a feed object?

When I try to access the protected property in the feed object, I get an error (Error: Cannot access protected property DrupalfeedsState::$messages)

Flow object:

enter description of image here

Anyone know how to get the protected property (messages) of the object?

object oriented – What are Java interfaces for? (multiple choice question)

A. They are used to describe the API of different classes.


I struggle with the correctness of the phrasing. This is not untrue, but it is essentially a confusing tautology. But they had to avoid calling it "the interface" so as not to give the answer, and I'm struggling to find a better alternative (and in the same concise way).

B. They are used to avoid having to specify the contract for the methods.

Quite the contrary, the interface East the contract.

C. They are used to let the actual and apparent types differ. You can only get this difference by using interfaces.

The first part of the statement is correct and basically describes the polymorphism.

The second part of the instruction is incorrect, as polymorphism also applies to inheritance.

python – Problem with object programming exercise

I was exercising and I encountered a problem. Here I instantiate Pokemon class objects, the problem is that when I run the program, I get this error

line 10, in atacar
AttributeError: 'Charmander' object has no attribute 'recibir_daño'

I was watching the teacher's video and I didn't see any difference, I don't know if it's the Python version or what, but I can't find the error.

Thanks in advance.

class BasePokemon:
    vida_base = None
    ataque = None
    nombre = None

    def __init__(self):
        self.vida = self.vida_base

    def atacar(self, enemigo):

    def recibir_dano(self, dano):
        self.vida -= dano

    def mostrar_vida(self):
        print("La vida actual de {} es {}.".format(self.nombre, self.vida))

class Charmander(BasePokemon):
    vida_base = 100
    ataque = 10
    nombre = "Charmander"

class Pikachu(BasePokemon):
    vida_base = 120
    ataque = 12
    nombre = "Pikachu"

class Bulbasur(BasePokemon):
    vida_base = 80
    ataque = 7
    nombre = "Bulbasur"

micharmander = Charmander()
tupikachu = Pikachu()