Server vector from int to float.

zoultrexzoultrex
edited August 2010 in Photon Server
Hi Guys

I have an operation in which I multiply two vectors and one of them will always have the x,y,z values in float from 0 to 1, this goes then into a another vector operation which is a simple two vector3 addition, but because the server item.Move function only receives int vector(which is the only vector class of the server) the result of my operation doesnt result in exactly what I expect it to be, and I believe its because of the concatenation from the float to int.

I have made the same thing that I am doing on the server but in unity using the float vectors and bingo!.

What options do you guys think I have to work around this?

(details of what I need to do: move object forward, for that I am multiplying the object forward vector by the distance I want it to move per loop, then add to the position vector , so (float vector * float value + add to float vector))

Comments

  • the newest version allows you to use your own vector type by implementing ICoordinate.
    The default implementation in the mmo demo has floats.
    int values are now just used for internal interest management calculations.
  • Any tip on how to make the server migration less painfull as possible? ;)
  • the important changes are:
    - removed MmoItem OnMove, OnSpawn and OnPropertiesSet overrides; sending event in MmoActor operation methods instead
    - new ICoordinate implementation "Coordinate" for float[] positions
    - new extension methods for float[]/Coordinate/Vector conversion

    this affects the following files:
    - Photon.MmoDemo.Server/Coordinate.cs (new)
    - Photon.MmoDemo.Server/ExtensionMethods.cs (new)
    - Photon.MmoDemo.Server/MmoActor.cs
    - Photon.MmoDemo.Server/MmoClientInterestArea.cs
    - Photon.MmoDemo.Server/MmoItem.cs
    and maybe
    - Photon.MmoDemo.Server/MmoPeer.cs
    - Photon.MmoDemo.Server/MmoRadar.cs

    so try diff these files.
Sign In or Register to comment.