unity – Rotating fps rigid body on the Y axis

I’m currently attempting to make a first person character using a rigid body. I am aware that the character controller exists, but I believe my game will be very physics based so it’s better if my character is a rigid body. I currently can walk, and rotate the camera up and down with the mouse. I am now trying to rotate my character left and right with the mouse, but this requires me to rotate my rigid body, not just the camera. Here’s my code so far.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour
{
    (SerializeField) float walkSpeed = 3;
    (SerializeField) float cameraSpeed = 3;

    Vector3 direction;
    float cameraX;

    Rigidbody myRigidBody;
    (SerializeField) Camera myCamera;
    // Start is called before the first frame update
    void Start()
    {
        myRigidBody = GetComponent<Rigidbody>();
    }

    // Update is called once per frame
    void Update()
    {
        direction = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
        cameraX = -Input.GetAxis("Mouse Y") * cameraSpeed;

        myCamera.transform.Rotate(new Vector3(cameraX, 0, 0));
    }
    void FixedUpdate()
    {
        myRigidBody.AddForce(direction * walkSpeed, ForceMode.Acceleration);
    }

I believe that the rigid body function I should use to rotate left and right is MoveRotation (I’m still new to rigid bodies), but I’m open to ideas. MoveRotation uses Quaternions, and I have no idea how to translate my mouse axis into a quaternion.

Here’s my question, How do i implement the Y rotation for my rigid body first person controller? Should I use torque, or somehow directly alter my rotation without using forces? Also, How do i translate the Mouse Axis into something I can use to rotate something? thnx.

mathematics – Predict future position of a moving body in Phaser arcade physics

I am looking for an equation for predicting the future position of a moving arcade physics body in Phaser 3. The body has drag applied and isDamping set to true. Phaser applies the drag using the following run on each update (showing x axis only but same applies to y).

//  Damping based deceleration
dragX = Math.pow(dragX, delta);

velocityX *= dragX;

Given the above, how would I write a kinetic equation to predict the future position?

I am currently using the method below, where I am iterating over frames to calculate the position accumulatively. But this is inefficient and inelegant so would prefer a solution which estimates the position without any looping.

public futurePosition(timeInSeconds: number): Phaser.Math.Vector2 {
  const DELTA = 1 / 60; // Assume we are running at 60fps
  const DRAG = 0.3; // Drag value
  const position = this.position.clone(); // Current position of body
  const velocity = this.body.velocity.clone(); // Current velocity

  // Inefficiently looping through frames
  for (let i = 0; i < timeInSeconds / (DELTA * 1000); i++) {
    velocity.x *= Math.pow(DRAG, DELTA);
    velocity.y *= Math.pow(DRAG, DELTA);
    position.x += velocity.x * DELTA;
    position.y += velocity.y * DELTA;
  }

  return position;
}

Any help appreciated. Thanks.

mathematics – Predict future position of a moving body in Phaser’s arcade physics

I am looking for an equation for predicting the future position of a moving arcade physics body in Phaser 3. The body has drag applied and isDamping set to true. Phaser applies the drag using the following run on each update (showing x axis only but same applies to y).

//  Damping based deceleration
dragX = Math.pow(dragX, delta);

velocityX *= dragX;

Given the above, how would I write a kinetic equation to predict the future position?

I am currently using the method below, where I am iterating over frames to calculate the position accumulatively. But this is inefficient and inelegant so would prefer a solution which estimates the position without any looping.

public futurePosition(timeInSeconds: number): Phaser.Math.Vector2 {
  const DELTA = 1 / 60; // Assume we are running at 60fps
  const DRAG = 0.3; // Drag value
  const position = this.position.clone(); // Current position of body
  const velocity = this.body.velocity.clone(); // Current velocity

  // Inefficiently looping through frames
  for (let i = 0; i < timeInSeconds / (DELTA * 1000); i++) {
    velocity.x *= Math.pow(DRAG, DELTA);
    velocity.y *= Math.pow(DRAG, DELTA);
    position.x += velocity.x * DELTA;
    position.y += velocity.y * DELTA;
  }

  return position;
}

Any help appreciated. Thanks.

mysql – ERROR Unhandled error during request: FetchError: invalid json response body at t reason: Unexpected token A in JSON at position 0

Error Image on Vercel

Error please install mysql2 manually

ERROR Unhandled error during request: Error: Please install mysql2 package manually
at ConnectionManager._loadDialectModule (/var/task/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:81:15)
at new ConnectionManager (/var/task/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:25:21)
at new MysqlDialect (/var/task/node_modules/sequelize/lib/dialects/mysql/index.js:15:30)
at new Sequelize (/var/task/node_modules/sequelize/lib/sequelize.js:340:20)

body mass index (BMI) calculator with cool images

I’m selling my website
body mass index or BMI http://tafsiralahlamibnsirin.com/
This website will help your visitors calculate their BMI (Body Mass Index)
SEMrush

Why this niche is important?
Weight has been one of the things most people have become focused on in later years
The body mass index or BMI as it’s usually shortened is a simple method, devised in order to determine, based on the height and current weight of a person whether or not they need to start working on losing weight fast.

What this site is about?

This website is about Body Mass Index (BMI) which is a measure of body fat based on height and weight that applies to adult men and women. Enter your weight and height using standard or metric measures.
It has two Body Mass Index Calculators, one in English and one in Metric values.
It also generates an image with your status form females and males it’s really cool

How can i use this site?
This can used as separate site , or can used as addon for an existing health website or forum.
the site is very simple and very easy to modify it uses jquey to maintain cross-browser supports.
The sale includes?

  • Website script
  • I will help you to install it
  • Great .com domain name

Additional Features:

  • It uses a light weight script
  • Easily to customize and change
  • It shows your Your BMI
  • It shows you your suggested healthy weight range
  • It shows Your BMI category
  • it gives you information about your BMI category
  • It shows the rate without reloading the page
  • The images are pre-loaded into the users’ computer memory so that it can be instantly accessed when needed
  • The design is very simple to make it easy to use it as a plugin for an existing website or to use it in your own templete

How can i make money?
You can use Adsense or any PPC alternative like Infolinks and Clicksor
you can use Amazon affiliate, clickbank which offer 75% commission

 

pentax – How do I tell if a lens is compatible with a given camera body?

The first task you have to figure out lens compatibility is to find out what lens mount your camera body uses. Pentax 35mm film SLRs and dSLRs use the Pentax K mount.

The second task is to find out what lens mounts the lenses are using, and whether or not it’s Pentax K. That may be harder than it sounds :). But all of the lenses on your list are from 3rd party lens manufacturers (i.e., not someone who makes the same brand of camera), so you have to be extra careful because 3rd party lens manufacturers like Sigma often make the same lens in multiple mounts. And a brand like Vivitar is often used to rebrand many different generic lens manufacturers. You’ll probably have to google each lens model specifically, or look very closely at the sale listings to see if they’re Pentax K. And you may also want to consult a visual lens mount guide like this or this.

The third and final task is to find out how much function the lens will give you. There are often reasons 3rd-party lenses can be found super-cheap on the used market, since OEM camera manufacturers have no vested interest in maintaining compatibility with 3rd-party lenses for functions like autofocus. And a mount like Pentax K or Nikon F, which have been around for decades often can encompass a myriad of quirks and incompatibilities as the mount and its electronic communication has been modified through the years. Googling “Pentax Lens compatibility” resulted in this chart, which charts out Pentax lens compatibility by specific Pentax bodies. And Ricoh themselves have a chart on the functional differences between versions of the K-mount.

It may come down to individually googling each lens with “K-x” to see if someone has mentioned the lens works or doesn’t work (or how much), but it may also be you’re just out of luck and will have to buy the lens to see if it works.

8 – “Can’t migrate source field body of type text_with_summary configured with plain text processing.”

I am trying to migrate a Drupal 7 site to Drupal 8, but I get the following error message.

Can’t migrate source field body of type text_with_summary configured with plain text processing. https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#plain-text

I read the linked documentation page and changed the body field in every content type to filtered, but the error persists.

How can I resolve this issue?