Tag Info

Hot answers tagged

3

When using an Effect in the Toolkit (which is similar to the XNA Effect or the native D3D11 Effect API), you are not suppose to access directly the constant buffer but instead setting parameters directly on the effect: _effect.Parameters["slideX"].SetValue(0.0f); _effect.Parameters["sinPi075"].SetValue((float)Math.Sin(Math.PI * 0.75)); ...


2

It looks like your code to mirror the bullet's angle just flips the sign of the angle. This works great for reflecting an angle about the x-axis. 45 degrees becomes -45 degrees, etc. Now imagine reflecting off a wall that itself has an angle of 90 degrees. In this case, 85 degrees is reflected to 95 degrees; 45 degrees becomes 135 degrees, etc. Basically ...


2

you are in a voxel engine which means that each box should have a discrete x, y and z coordinate thus: if you have a box at index (x, y, z) then you can get all neighbouring boxes by getting the boxes at index (x, y +/- 1, z), (x +/- 1, y, z) and (x, y, z +/- 1) edit: after some more info... just detect the collisions for a line between the center of the ...


2

I'm working under Unity, and I'd like to know if it would be possible to somehow query the material + shader of each GameObject that has a Mesh Renderer attached to itself, in order to find out how much light has fallen on the 3D model. As per Unity's documentation, Unity does not provide such functionality, so it's not possible to achieve what you ...


1

Velocity is a 2-dimensional value, representing the speed in both the X and Y directions. I notice you have velocity and velocity2; it might make things easier to use a 2D vector for velocity, like you do for position. To calculate the speed in the X and Y directions, just multiply your total speed by the cos (for the horizontal component) and sin (for the ...


1

This should do the job, it will follow the player and face the player as well. Hope this helped. using UnityEngine; using System.Collections; public class ChasePlayerAI : MonoBehaviour { public Transform target;//set target from inspector instead of looking in Update public float speed = 3f; void Update() { //rotate to look at the player ...


1

Autodesk has a FBX Converter, which can take .objs and output .fbx. Included is a command line tool, which you could call from your game at runtime. As long as you do not want to have that functionality distributed to every player, that should be enough.



Only top voted, non community-wiki answers of a minimum length are eligible