CN107261500B - Method and device for positioning object and mobile terminal - Google Patents

Method and device for positioning object and mobile terminal Download PDF

Info

Publication number
CN107261500B
CN107261500B CN201710423424.2A CN201710423424A CN107261500B CN 107261500 B CN107261500 B CN 107261500B CN 201710423424 A CN201710423424 A CN 201710423424A CN 107261500 B CN107261500 B CN 107261500B
Authority
CN
China
Prior art keywords
line segment
route
distance
point
abscissa
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710423424.2A
Other languages
Chinese (zh)
Other versions
CN107261500A (en
Inventor
余深瑞
曾汉铭
赖金
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kailuo Tianxia Technology Co ltd
Original Assignee
Beijing Kailuo Tianxia Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kailuo Tianxia Technology Co ltd filed Critical Beijing Kailuo Tianxia Technology Co ltd
Priority to CN201710423424.2A priority Critical patent/CN107261500B/en
Publication of CN107261500A publication Critical patent/CN107261500A/en
Application granted granted Critical
Publication of CN107261500B publication Critical patent/CN107261500B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16ZINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS, NOT OTHERWISE PROVIDED FOR
    • G16Z99/00Subject matter not provided for in other main groups of this subclass
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/64Methods for processing data by generating or executing the game program for computing dynamical parameters of game objects, e.g. motion determination or computation of frictional forces for a virtual car
    • A63F2300/646Methods for processing data by generating or executing the game program for computing dynamical parameters of game objects, e.g. motion determination or computation of frictional forces for a virtual car for calculating the trajectory of an object

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Navigation (AREA)
  • Control Of Position, Course, Altitude, Or Attitude Of Moving Bodies (AREA)

Abstract

The invention discloses a method, a device and a mobile terminal for positioning an object, wherein the object moves from a route starting point to a route end point of a preset route, the preset route is formed by connecting a plurality of line segments in sequence, each line segment has a corresponding line segment starting point, a line segment end point, a minimum distance and a maximum distance, and the distance between the route starting point and the route end point is the maximum length of the preset route, the method comprises the following steps: acquiring a movement attribute and a movement time interval of the object, wherein the movement attribute comprises the current speed of the object and the current distance between the object and the starting point of the route; calculating and updating the current distance according to the movement attribute and the movement time interval; if the current distance is smaller than the maximum length, comparing the current distance with the minimum distance and the maximum distance of each line segment to obtain the line segment corresponding to the position to which the object should move currently; and calculating a distance difference value of the current distance and the minimum distance of the corresponding line segment, and positioning the object to the position of the line segment, which is away from the starting point of the line segment by the distance difference value.

Description

Method and device for positioning object and mobile terminal
Technical Field
The invention relates to the field of mobile internet and games, in particular to a method and a device for positioning an object and a mobile terminal.
Background
When the mobile terminal is not developed greatly, each game company mainly uses a PC as a carrier to provide game software for users so as to facilitate the installation and use of the users, but the PC has a large volume and is very unchanged when being carried. With the continuous development of hardware technology and mobile internet technology, mobile terminal devices such as smart phones and tablet computers are widely popularized, mobile terminals including smart phones have gradually penetrated through various aspects of our daily lives, more and more game companies turn sightseeing from end-to-end game to hand-game market in consideration of the portability of smart phones, and the development of a popular hand-game becomes the primary target of many game companies.
However, the hand games are various, the core technologies of different types of games are different, and the problems to be solved are different. For example, for tower defense type games, the player is typically a defender, and needs to destroy monsters by creating an attacking device such as a turret, and the monsters typically follow a fixed path of travel toward the player's location or target to be protected. Therefore, there is a need to ensure that monsters can still follow a fixed path of travel when subjected to turret attacks (including blood volume reduction, speed reduction, etc.), by quickly locating monsters to avoid the occurrence of path deviation.
In the existing positioning method, the position of a current monster needs to be arbitrarily positioned, coordinates need to be set, and a game engine can draw the monster at the position corresponding to the coordinates. For example, assuming that the traveling route is line segment AB, the monster starts from point a and can travel to point B after time T1, an action (i.e., an animation function of movement of the coordinates of the monster) is given to the monster, and the monster is made to travel for time T1 to point B. If the monster smoothly moves to the point B, the monster can be given the next action so as to continue to move. If a deceleration operation is in the middle (e.g. the turret fires a bullet with deceleration and hits a monster) breaks this action, e.g. at point a1 between segments AB, the monster is now decelerated, the original walking action is broken, the action is discarded, a new action is calculated at point a1, and the monster is given a new action at a new speed, i.e. how long it takes to move slowly from point a1 to point B. If the speed is recovered after walking a short distance to reach a2 point between segments AB, the time required for walking from a2 point to B point needs to be calculated again to give a new action again, which causes a large load on game operation due to the action of reproducing a monster for many times, and easily causes a route deviation.
Disclosure of Invention
To this end, the present invention provides a solution for locating objects in an attempt to solve or at least alleviate the above-presented problems.
According to an aspect of the present invention, there is provided a method of locating an object, adapted to be performed in a mobile terminal, the object moving from a route start point to a route end point of a preset route, the preset route being composed of a plurality of line segments connected in sequence, each line segment having a corresponding line segment start point, a line segment end point, a minimum distance from the line segment start point to the route start point, and a maximum distance from the line segment end point to the route start point, wherein the line segment start point of a first line segment and the line segment end point of a last line segment are the route start point and the route end point, respectively, and a distance between the route start point and the route end point is a maximum length of the preset route, the method comprising the: acquiring a movement attribute and a movement time interval of the object, wherein the movement attribute comprises the current speed of the object and the current distance between the object and the starting point of the route; calculating and updating the current distance according to the movement attribute and the movement time interval; judging whether the current distance is smaller than the maximum length; if the current distance is smaller than the maximum length, comparing the current distance with the minimum distance and the maximum distance of each line segment to obtain the line segment corresponding to the position to which the object should move currently; and calculating a distance difference value of the current distance and the minimum distance of the corresponding line segment, and positioning the object to the position of the line segment, which is away from the starting point of the line segment by the distance difference value.
Optionally, in the method for locating an object according to the present invention, the step of calculating and updating the current distance according to the movement attribute and the movement time interval includes: obtaining the product of the current speed of the object and the moving time interval as the distance increment; and calculating the sum of the distance increment and the current distance to update the current distance.
Optionally, in the method for positioning an object according to the present invention, the step of comparing the current distance with the minimum distance and the maximum distance of each line segment to obtain the line segment corresponding to the position to which the object should move currently includes: comparing the current distance with the minimum distance and the maximum distance of each line segment in sequence; and acquiring a line segment of which the minimum distance is not more than the current distance and the maximum distance is not less than the current distance, and taking the line segment as a line segment corresponding to the position to which the object should be moved currently.
Optionally, in the method for locating an object according to the present invention, the method further includes: if the current distance is not less than the maximum length, judging whether the route starting point and the route end point are overlapped; if the route starting point coincides with the route ending point, the difference between the current distance and the maximum length is calculated to update the current distance.
Optionally, in the method for locating an object according to the present invention, the method further includes: if the starting point of the route is not coincident with the ending point of the route, the object is indicated to reach the ending point of the route, and the object is indicated to execute a preset instruction corresponding to the ending point of the route.
Optionally, in the method for locating an object according to the present invention, the method further includes setting an orientation of the object when moving according to the position of the object.
Optionally, in the method for locating an object according to the present invention, the step of setting the orientation of the object when moving according to the position of the object includes: respectively acquiring screen coordinates of a line segment starting point and a line segment ending point of a line segment corresponding to the position of the object, wherein the screen coordinates comprise an abscissa and an ordinate; if the abscissa of the starting point of the line segment is equal to the abscissa of the end point of the line segment, respectively acquiring the screen coordinates of the starting point of the line segment and the end point of the line segment of the next line segment connected with the line segment; if the abscissa of the starting point of the next line segment is smaller than the abscissa of the ending point of the line segment, setting the direction of the object when moving to be horizontal and rightward; if the abscissa of the start point of the next line segment is larger than the abscissa of the end point of the line segment, the orientation when the object moves is set to the horizontal left.
Optionally, in the method for locating an object according to the present invention, the step of setting an orientation of the object when moving according to the position of the object further includes: if the abscissa of the starting point of the line segment is smaller than the abscissa of the end point of the line segment, setting the direction of the object when moving to be horizontal to the right; if the abscissa of the start point of the segment is larger than the abscissa of the end point of the segment, the orientation when the object moves is set to the horizontal left.
According to still another aspect of the present invention, there is provided an apparatus for locating an object, the object moving from a route start point to a route end point of a preset route, the preset route being composed of a plurality of line segments connected in sequence, each line segment having a corresponding line segment start point, a line segment end point, a minimum distance from the line segment start point to the route start point, and a maximum distance from the line segment end point to the route start point, wherein the line segment start point of a first line segment and the line segment end point of a last line segment are the route start point and the route end point, respectively, and a distance between the route start point and the route end point is a maximum length of the preset route, the apparatus comprising a first obtaining module, an updating module, a judging module, a second obtaining module. The first acquisition module is suitable for acquiring a movement attribute and a movement time interval of the object, wherein the movement attribute comprises the current speed of the object and the current distance between the object and the starting point of the route; the updating module is suitable for calculating and updating the current distance according to the movement attribute and the movement time interval; the judging module is suitable for judging whether the current distance is smaller than the maximum length; the second obtaining module is suitable for comparing the current distance with the minimum distance and the maximum distance of each line segment when the current distance is smaller than the maximum length so as to obtain the line segment corresponding to the position to which the object should move currently; the positioning module is suitable for calculating a distance difference value of the current distance and the minimum distance of the corresponding line segment, and positioning the object to the position of the distance difference value of the line segment from the starting point of the line segment.
Optionally, in the apparatus for locating an object according to the present invention, the update module is further adapted to: obtaining the product of the current speed of the object and the moving time interval as the distance increment; and calculating the sum of the distance increment and the current distance to update the current distance.
Optionally, in the apparatus for locating an object according to the present invention, the second obtaining module is further adapted to: comparing the current distance with the minimum distance and the maximum distance of each line segment in sequence; and acquiring a line segment of which the minimum distance is not more than the current distance and the maximum distance is not less than the current distance, and taking the line segment as a line segment corresponding to the position to which the object should be moved currently.
Optionally, in the apparatus for positioning an object according to the present invention, the determining module is further adapted to determine whether the route starting point and the route ending point coincide with each other when the current distance is not less than the maximum length; the updating module is further adapted to calculate a difference between the current distance and the maximum length to update the current distance when the route start point coincides with the route end point.
Optionally, in the apparatus for locating an object according to the present invention, an indication module adapted to: and when the route starting point and the route ending point do not coincide, indicating that the object reaches the route ending point, and indicating the object to execute a preset instruction corresponding to the route ending point.
Optionally, in the apparatus for positioning an object according to the present invention, a setting module adapted to set an orientation of the object when moving according to the position of the object is further included.
Optionally, in the apparatus for locating an object according to the present invention, the setting module is further adapted to: respectively acquiring screen coordinates of a line segment starting point and a line segment ending point of a line segment corresponding to the position of the object, wherein the screen coordinates comprise an abscissa and an ordinate; when the abscissa of the starting point of the line segment is equal to the abscissa of the end point of the line segment, respectively acquiring the screen coordinates of the starting point of the line segment and the end point of the line segment of the next line segment connected with the line segment; setting the direction of the object when moving to the horizontal right when the abscissa of the start point of the next line segment is smaller than the abscissa of the end point of the line segment; when the abscissa of the start point of the next line segment is larger than the abscissa of the end point of the line segment, the orientation when the object moves is set to the horizontal left.
Optionally, in the apparatus for locating an object according to the present invention, the setting module is further adapted to: setting the orientation of the object when moving to the horizontal right when the abscissa of the start point of the segment is smaller than the abscissa of the end point of the segment; when the abscissa of the start point of the segment is larger than the abscissa of the end point of the segment, the orientation when the object moves is set to the horizontal left.
According to yet another aspect of the present invention, there is provided a mobile terminal comprising an apparatus for locating an object according to the present invention.
According to yet another aspect of the present invention, there is provided a mobile terminal comprising one or more processors, memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing the method of locating an object according to the present invention.
According to yet another aspect of the present invention, there is also provided a computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a mobile terminal, cause the mobile terminal to perform a method of locating an object according to the present invention.
According to the scheme of the invention, an object to be positioned moves from a route starting point to a route ending point in a preset route formed by connecting a plurality of line segments in sequence, each line segment has a corresponding line segment starting point, a line segment ending point, a minimum distance and a maximum distance from the route starting point, wherein the line segment starting point of a first line segment and the line segment ending point of a last line segment are respectively the route starting point and the route ending point, the distance between the route starting point and the route ending point is the maximum length of the preset route, when the object is positioned, firstly, the movement attribute and the movement time interval of the object are obtained, the movement attribute comprises the current speed of the object and the current distance between the object and the route starting point, the current distance is calculated and updated according to the movement attribute and the movement time interval, if the current distance is less than the maximum length, the current distance is compared with the minimum distance and the maximum distance of each line, and finally, calculating the distance difference value of the current distance and the minimum distance of the corresponding line segment, and positioning the object to the position of the line segment away from the starting point of the line segment by the distance difference value. In the above technical solution, when the object moves on a line segment in the preset route, if the speed changes due to some factors, such as speed reduction, a new current distance is calculated by the changed current speed, that is, the object can be repositioned by using the updated current distance, so that the object can be rendered and drawn directly at the position, and the time from the decelerated point to the end point of the line segment does not need to be recalculated by using the changed current speed, so that a new action is calculated on the basis of the time to be given to the object, thereby indicating that the object moves at the new speed, avoiding increasing the system operation load due to multiple copying actions on the object due to speed change, and reducing the possibility of route deviation. In addition, when the object moves, the direction of the object during moving can be directly set according to the screen coordinates of the line segment starting point and the line segment ending point of the line segment corresponding to the position of the object, and the direction of the object moving can be set by combining the next line segment connected with the line segment, so that the moving process of the object can be better displayed while the moving object is accurately and quickly positioned.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
Fig. 1 illustrates a block diagram of a mobile terminal 100 according to an embodiment of the present invention;
FIG. 2 shows a flow diagram of a method 200 of locating an object according to one embodiment of the invention;
FIG. 3 shows a schematic diagram of a preset route according to one embodiment of the invention;
FIG. 4 shows a schematic diagram of an apparatus 400 for locating an object according to one embodiment of the invention;
FIG. 5 shows a schematic diagram of an apparatus 500 for locating objects according to yet another embodiment of the invention; and
fig. 6 shows a schematic view of an apparatus 600 for locating an object according to yet another embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a block diagram of a mobile terminal 100. The mobile terminal 100 may include a memory interface 102, one or more data processors, image processors and/or central processing units 104, and a peripheral interface 106.
The memory interface 102, the one or more processors 104, and/or the peripherals interface 106 can be discrete components or can be integrated in one or more integrated circuits. In the mobile terminal 100, the various elements may be coupled by one or more communication buses or signal lines. Sensors, devices, and subsystems can be coupled to peripheral interface 106 to facilitate a variety of functions.
For example, a motion sensor 110, a light sensor 112, and a distance sensor 114 may be coupled to the peripheral interface 106 to facilitate directional, lighting, and ranging functions. Other sensors 116 may also be coupled to the peripheral interface 106, such as a positioning system (e.g., a GPS receiver), a temperature sensor, a biometric sensor, or other sensing device, to facilitate related functions.
The camera subsystem 120 and optical sensor 122, which may be, for example, a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) optical sensor, may be used to facilitate implementation of camera functions such as recording photographs and video clips. Communication functions may be facilitated by one or more wireless communication subsystems 124, which may include radio frequency receivers and transmitters and/or optical (e.g., infrared) receivers and transmitters. The particular design and implementation of the wireless communication subsystem 124 may depend on the one or more communication networks supported by the mobile terminal 100. For example, the mobile terminal 100 may include a network designed to support LTE, 3G, GSM networks, GPRS networks, EDGE networks, Wi-Fi or WiMax networks, and BluetoothTMA communication subsystem 124 of the network.
The audio subsystem 126 may be coupled to a speaker 128 and a microphone 130 to facilitate voice-enabled functions, such as voice recognition, voice replication, digital recording, and telephony functions. The I/O subsystem 140 may include a touch screen controller 142 and/or one or more other input controllers 144. The touch screen controller 142 may be coupled to a touch screen 146. For example, the touch screen 146 and touch screen controller 142 may detect contact and movement or pauses made therewith using any of a variety of touch sensing technologies, including but not limited to capacitive, resistive, infrared, and surface acoustic wave technologies. One or more other input controllers 144 may be coupled to other input/control devices 148 such as one or more buttons, rocker switches, thumbwheels, infrared ports, USB ports, and/or pointing devices such as styluses. The one or more buttons (not shown) may include up/down buttons for controlling the volume of the speaker 128 and/or microphone 130.
The memory interface 102 may be coupled with a memory 150. The memory 150 may include high speed random access memory and/or non-volatile memory, such as one or more magnetic disk storage devices, one or more optical storage devices, and/or flash memory (e.g., NAND, NOR). The memory 150 may store an operating system 172, such as an operating system like Android, iOS, or windows phone. The operating system 172 may include instructions for handling basic system services and for performing hardware dependent tasks. The memory 150 may also store applications 174. While the mobile device is running, the operating system 172 is loaded from the memory 150 and executed by the processor 104. The application 174, when running, is also loaded from the memory 150 and executed by the processor 104. The applications 174 run on top of the operating system and utilize the interfaces provided by the operating system and the underlying hardware to implement various user-desired functions, such as instant messaging, web browsing, picture management, and the like. The application 174 may be provided independent of the operating system or may be self-contained. In addition, a driver module may also be added to the operating system when the application 174 is installed in the mobile terminal 100. Among the various applications 174 described above, one of them is an apparatus 400 for locating objects according to the present invention.
FIG. 2 shows a flow diagram of a method 200 of locating an object according to one embodiment of the invention. The method 200 of locating an object is suitable for execution in a mobile terminal, such as the mobile terminal 100 shown in fig. 1. In the method 200, an object to be positioned moves on a preset route from a route start point of the preset route to a route end point, the preset route is composed of a plurality of line segments connected in sequence, each line segment has a corresponding line segment start point, a line segment end point, a minimum distance from the line segment start point to the route start point and a maximum distance from the line segment end point to the route start point, the line segment start point of a first line segment and the line segment end point of a last line segment are respectively the route start point and the route end point, and the distance between the route start point and the route end point is the maximum length of the preset route. FIG. 3 shows a schematic diagram of a preset route according to one embodiment of the invention. As shown in fig. 3, the route along which the object moves is a preset route AJ, and the object moves from a route starting point a to a route ending point J on the preset route AJ, where the preset route AJ is composed of 9 line segments, which are line segments AB, BC, CD, DE, EF, FG, GH, HI, and IJ, and obviously, the line segment starting point a of the first line segment AB is the route starting point a, and the line segment ending point J of the last line segment IJ is the route ending point J. Taking the line segment CD as an example, the line segment starting point is C, the line segment end point is D, the minimum distance from the line segment starting point C to the route starting point a is the sum of the lengths of the line segments AB and BC, and the maximum distance from the line segment end point D to the route starting point a is the sum of the lengths of the line segments AB, BC and CD. The distance between the route starting point a and the route ending point J is the sum of the lengths of the line segments AB, BC, CD, DE, EF, FG, GH, HI, and IJ, and is the maximum length of the preset route AJ. In this embodiment, the preset route AJ may be represented by the following data structure:
class Road public Array// Preset route
{
Position a; // starting Point A
Position j; // end point J
Int maxLen; // maximum length of preset course
class Line1// Line segment AB
{
Position primoPos; // Screen coordinates of line segment origin
Position nextPos; // line end point screen coordinates
Int minLen; // minimum distance of line segment
Int maxLen; // maximum distance of line segment
}
class Line 2; // line segment BC
……
class Line 9; // line segment IJ
}
As shown in fig. 2, the method 200 begins at step S210. In step S210, a movement attribute and a movement time interval of the object are acquired, the movement attribute including a current speed of the object and a current distance of the object from the start point of the route. According to an embodiment of the present invention, the current speed of the object is 2cm/s, the current distance between the object and the route starting point a is 12cm, and the movement attribute may further include the screen coordinates of the object, which may be specifically referred to the following data format of the movement attribute:
class Creep
{
float curLen; // current distance from the route start A
Position primoPos; // last Screen coordinates
Position currPos; // current screen coordinates
Float speed; // Current speed
}
Further, the moving time interval is related to the current frame rate, and is generally set to be a time of one frame, i.e. the moving time interval is 1/the current frame rate. The current frame rate can be adjusted in real time, and to avoid the stuck, the moving time interval can be properly increased, for example, the moving time interval is set to be the time of multiple frames, and once the stuck phenomenon occurs, the time of the stuck can be directly added to the original moving time interval due to the fact that the time is prolonged. In this embodiment, the current frame rate is 30FPS, and the movement time interval is set to 1/30 s.
First, the product of the current speed of the object and the moving time interval is obtained as a distance increment, and it is known from step S210 that the current speed of the object is 2cm/S and the moving time interval is 1/30S, so that the distance increment is 2 × 1/30-0.067 cm, and then, the sum of the distance increment and the current distance is calculated to update the current distance, so that the updated current distance is 12+ 0.067-12.067 cm.
After obtaining the new current distance of the object, step S230 is executed to determine whether the current distance is smaller than the maximum length. According to an embodiment of the present invention, the maximum length is 35cm, and the current distance is 12.067cm, and it can be determined that the current distance is smaller than the maximum length. The key codes for determining the size relationship between the current distance and the maximum length are as follows:
increment of position sub (critical. curpos-critical. priopos)// calculating the movement increment
critical
if creep.curLen>=Road.MaxLen
// reach route end
else
If the destination of the route is not reached, each line segment of the preset route is traversed, and whether the next line segment is needed to be reached is judged
foreach line,Road
if creep.curLen==line.minLen
// go to the next line segment
creep.curLen=line.minLen;
moveCreep (line. prioPos)// starting point of line segment moved to next line segment
end if
end for
end if
If the current distance is smaller than the maximum length, step S240 is performed to compare the current distance with the minimum distance and the maximum distance of each line segment, so as to obtain the line segment corresponding to the position to which the object should be moved. According to an embodiment of the present invention, a line segment corresponding to a position to which an object should be currently moved may be acquired in the following manner. First, the current distance is sequentially compared with the minimum distance and the maximum distance of each line segment. In this embodiment, the minimum distances of the line segments AB, BC, CD, DE, EF, FG, GH, HI and IJ are 0cm, 4cm, 9cm, 13cm, 16cm, 18cm, 25cm, 28.5cm and 30cm in this order, and the maximum distances are 4cm, 9cm, 13cm, 16cm, 18cm, 25cm, 28.5cm, 30cm and 35cm in this order. Obviously, for two connected line segments, the maximum distance of the previous line segment is the minimum distance of the next line segment, so that in actual processing, the line segment with the first minimum distance greater than the current distance can be obtained by sequentially comparing the current distance with the minimum distances of the line segments, and the previous line segment connected with the line segment is the line segment corresponding to the position to which the object should move currently. For example, the current distance 12.067cm is compared with the minimum distance of the 9 line segments in sequence, the minimum distance of the line segment CD is 9cm, the minimum distance of the line segment DE is 13cm, and it is known that the line segment with the first minimum distance greater than the current distance is the line segment DE, and the previous line segment CD connected to the line segment DE is the line segment corresponding to the position to which the object should move currently.
Finally, in step S250, a distance difference between the current distance and the minimum distance of the corresponding line segment is calculated, and the object is positioned at a position of the line segment which is apart from the start point of the line segment by the distance difference. According to an embodiment of the present invention, it can be known in step S240 that the line segment corresponding to the current distance is the line segment CD, and the distance difference between the current distance and the minimum distance of the line segment CD is 12.067-9 ═ 3.067cm, at this time, the object is located at a position 3.067cm away from the starting point C of the line segment CD.
In step S230, it is determined whether the current distance is smaller than the maximum length, and further, if the current distance is not smaller than the maximum length, it is determined whether the route start point and the route end point coincide with each other. If the route starting point is coincident with the route end point, the preset route is closed, the object starts from the route starting point when arriving at the route end point, the difference between the current distance and the maximum length is calculated to update the current distance, and the object is positioned according to the updated current distance. If the route starting point and the route ending point do not coincide, it indicates that the object has reached the route ending point.
When the object moves on the preset route, in order to better show the moving process of the object, the moving time and the orientation of the object can be set according to the position of the object. According to yet another embodiment of the present invention, the orientation of the object when moving is set by the following manner. First, screen coordinates of a line segment start point and a line segment end point of a line segment corresponding to the position of the object are respectively obtained, the screen coordinates include an abscissa and an ordinate, in this embodiment, the line segment corresponding to the position of the object is a line segment CD, the screen coordinates of a line segment start point C of the line segment CD are (80px,60px), and the screen coordinates of a line segment end point D are (100px,60px), which indicates that the abscissa of the line segment start point C of the line segment CD is 80px, the ordinate is 60px, the abscissa of the line segment end point D is 100px, and the ordinate is 60 px. Subsequently, it is determined whether the abscissa of the start point of the segment is equal to the abscissa of the end point of the segment, and the orientation when the object moves is set according to the determination result. In this regard, it is necessary to discuss the three cases, that is, the abscissa of the start point of the segment is equal to the abscissa of the end point of the segment, which is smaller than the abscissa of the end point of the segment, and the abscissa of the start point of the segment is larger than the abscissa of the end point of the segment. For the first case, if the abscissa of the start point of the segment is equal to the abscissa of the end point of the segment, the screen coordinates of the start point of the segment and the end point of the segment of the next segment connected to the segment are respectively obtained, if the abscissa of the start point of the segment of the next segment is smaller than the abscissa of the end point of the segment, the direction of the object when moving is set to the horizontal right, and if the abscissa of the start point of the segment of the next segment is larger than the abscissa of the end point of the segment, the direction of the object when moving is set to the horizontal left. For the second case, if the abscissa of the start point of the segment is smaller than the abscissa of the end point of the segment, the orientation when the object moves is set to the horizontal right. For the third case, if the abscissa of the start point of the segment is larger than the abscissa of the end point of the segment, the orientation when the object moves is set to the horizontal left. In the above embodiment, the abscissa of the line segment start point C is smaller than the abscissa of the line segment end point D, which corresponds to the determination result in the second case, and therefore, the orientation when the object moves is set to the horizontal left.
Fig. 4 shows a schematic diagram of an apparatus 400 for locating an object according to an embodiment of the present invention. The object to be positioned moves from a route starting point to a route ending point of a preset route, the preset route is formed by connecting a plurality of line segments in sequence, each line segment is provided with a corresponding line segment starting point, a line segment ending point, a minimum distance between the line segment starting point and the route starting point and a maximum distance between the line segment ending point and the route starting point, the line segment starting point of the first line segment and the line segment ending point of the last line segment are respectively the route starting point and the route ending point, and the distance between the route starting point and the route ending point is the maximum length of the preset route. As shown in fig. 4, the apparatus 400 for locating an object includes a first obtaining module 410, an updating module 420, a determining module 430, a second obtaining module 440, and a locating module 450.
The first obtaining module 410 is adapted to obtain a movement attribute and a movement time interval of the object, the movement attribute comprising a current speed of the object and a current distance of the object from the start of the route.
The updating module 420 is connected to the first obtaining module 410 and is adapted to calculate and update the current distance according to the movement attribute and the movement time interval. The update module 420 is further adapted to obtain the product of the current velocity of the object and the movement time interval as the distance increment; and calculating the sum of the distance increment and the current distance to update the current distance. The updating module 420 is further adapted to calculate a difference between the current distance and the maximum length to update the current distance when the route start point coincides with the route end point.
The determining module 430 is connected to the updating module 420 and adapted to determine whether the current distance is smaller than the maximum length. The determining module 430 is further adapted to determine whether the route starting point and the route ending point coincide with each other when the current distance is not less than the maximum length.
The second obtaining module 440 is respectively connected to the updating module 420 and the determining module 430, and is adapted to compare the current distance with the minimum distance and the maximum distance of each line segment when the current distance is smaller than the maximum length, so as to obtain the line segment corresponding to the position to which the object should be moved. The second obtaining module 440 is further adapted to compare the current distance with the minimum distance and the maximum distance of each line segment in sequence; and acquiring a line segment of which the minimum distance is not more than the current distance and the maximum distance is not less than the current distance, and taking the line segment as a line segment corresponding to the position to which the object should be moved currently.
The positioning module 450 is connected to the updating module 420 and the second obtaining module 440, respectively, and is adapted to calculate a distance difference between the current distance and the minimum distance of the corresponding line segment, and position the object at a position of the line segment that is apart from the start point of the line segment by the distance difference.
Fig. 5 shows a schematic diagram of an apparatus 500 for locating an object according to another embodiment of the present invention. As shown in fig. 5, the first obtaining module 510, the updating module 520, the determining module 530, the second obtaining module 540, and the positioning module 550 of the apparatus 500 for locating an object correspond to the first obtaining module 410, the updating module 420, the determining module 430, the second obtaining module 440, and the positioning module 450 of the apparatus 400 for locating an object in fig. 4 one-to-one, and are consistent, and an indicating module 560 connected to the determining module 530 is added, where the indicating module 560 is adapted to indicate that an object has reached a route end point when a route start point does not coincide with the route end point, and indicate that the object executes a preset instruction corresponding to the route end point.
Fig. 6 shows a schematic diagram of an apparatus 600 for locating an object according to another embodiment of the present invention. As shown in fig. 6, the first obtaining module 610, the updating module 620, the determining module 630, the second obtaining module 640, and the positioning module 650 of the apparatus 600 for positioning an object correspond to the first obtaining module 410, the updating module 420, the determining module 430, the second obtaining module 440, and the positioning module 450 of the apparatus 400 for positioning an object in fig. 4 one-to-one, and are consistent, and a setting module 670 connected to the positioning module 650 is added.
The setting module 670 is adapted to set an orientation of the object when moving according to where the object is located. The setting module 670 is further adapted to obtain screen coordinates of a line segment start point and a line segment end point of a line segment corresponding to a position where the object is located, respectively, where the screen coordinates include an abscissa and an ordinate; when the abscissa of the starting point of the line segment is equal to the abscissa of the end point of the line segment, respectively acquiring the screen coordinates of the starting point of the line segment and the end point of the line segment of the next line segment connected with the line segment; setting the direction of the object when moving to the horizontal right when the abscissa of the start point of the next line segment is smaller than the abscissa of the end point of the line segment; when the abscissa of the start point of the next line segment is larger than the abscissa of the end point of the line segment, the orientation when the object moves is set to the horizontal left. The setting module 670 is further adapted to set the orientation of the object while moving to the horizontal right when the abscissa of the start point of the segment is smaller than the abscissa of the end point of the segment; when the abscissa of the start point of the segment is larger than the abscissa of the end point of the segment, the orientation when the object moves is set to the horizontal left.
The specific steps and embodiments for positioning the object are disclosed in detail in the description based on fig. 2 to 3, and are not described herein again.
In the existing method for positioning an object, a position of a current object is arbitrarily positioned, and a coordinate needs to be set, so that the object can be drawn at a position corresponding to the coordinate to represent that the object moves to the current position. However, if the speed of the object changes during the moving process, the time for the object to reach the end point needs to be calculated every time the speed changes, so that a new action is newly given, which increases the system operation load due to the duplication of the object for many times, and easily causes route deviation. According to the technical scheme of the embodiment of the invention, an object to be positioned moves from a route starting point to a route ending point in a preset route formed by connecting a plurality of line segments in sequence, each line segment has a corresponding line segment starting point, a line segment ending point, a minimum distance and a maximum distance from the route starting point, wherein the line segment starting point of a first line segment and the line segment ending point of a last line segment are respectively the route starting point and the route ending point, the distance between the route starting point and the route ending point is the maximum length of the preset route, when the object is positioned, firstly, the movement attribute and the movement time interval of the object are obtained, the movement attribute comprises the current speed of the object and the current distance between the object and the route starting point, the current distance is calculated and updated according to the movement attribute and the movement time interval, if the current distance is smaller than the maximum length, the current distance is compared with the minimum distance and the maximum distance of each, and finally, calculating the distance difference value of the current distance and the minimum distance of the corresponding line segment, and positioning the object to the position of the line segment away from the starting point of the line segment by the distance difference value. In the above technical solution, when the object moves on a line segment in the preset route, if the speed changes due to some factors, such as speed reduction, a new current distance is calculated by the changed current speed, that is, the object can be repositioned by using the updated current distance, so that the object can be rendered and drawn directly at the position, and the time from the decelerated point to the end point of the line segment does not need to be recalculated by using the changed current speed, so that a new action is calculated on the basis of the time to be given to the object, thereby indicating that the object moves at the new speed, avoiding increasing the system operation load due to multiple copying actions on the object due to speed change, and reducing the possibility of route deviation. In addition, when the object moves, the direction of the object during moving can be directly set according to the screen coordinates of the line segment starting point and the line segment ending point of the line segment corresponding to the position of the object, and the direction of the object moving can be set by combining the next line segment connected with the line segment, so that the moving process of the object can be better displayed while the moving object is accurately and quickly positioned.
A7. The method as claimed in a6, wherein the step of setting the orientation of the object when moving according to the position of the object comprises:
respectively acquiring screen coordinates of a line segment starting point and a line segment ending point of a line segment corresponding to the position of an object, wherein the screen coordinates comprise an abscissa and an ordinate;
if the abscissa of the starting point of the line segment is equal to the abscissa of the end point of the line segment, respectively acquiring the screen coordinates of the starting point of the line segment and the end point of the line segment of the next line segment connected with the line segment;
if the abscissa of the starting point of the next line segment is smaller than the abscissa of the ending point of the line segment, setting the direction of the object when moving to be horizontal and rightward;
if the abscissa of the start point of the next line segment is larger than the abscissa of the end point of the line segment, the orientation when the object moves is set to the horizontal left.
A8. The method as claimed in a7, wherein the step of setting the orientation of the object when moving according to the position of the object further comprises:
if the abscissa of the starting point of the line segment is smaller than the abscissa of the end point of the line segment, setting the direction of the object when moving to be horizontal and rightward;
and if the abscissa of the starting point of the line segment is larger than the abscissa of the end point of the line segment, setting the direction of the object when the object moves to be horizontal to the left.
B10. The apparatus of B9, the update module further adapted to:
obtaining the product of the current speed of the object and the moving time interval as a distance increment;
and calculating the sum of the distance increment and the current distance to update the current distance.
B11. The apparatus of B9 or 10, the second obtaining module further adapted to:
comparing the current distance with the minimum distance and the maximum distance of each line segment in sequence;
and acquiring a line segment of which the minimum distance is not more than the current distance and the maximum distance is not less than the current distance, and taking the line segment as a line segment corresponding to the position to which the object should be moved currently.
B12. The apparatus of any one of B9-11, wherein:
the judging module is further adapted to judge whether the route starting point and the route ending point coincide with each other when the current distance is not less than the maximum length;
the updating module is further adapted to calculate a difference between the current distance and the maximum length to update the current distance when the route start point coincides with the route end point.
B13. The apparatus of B12, further comprising an indication module adapted to:
when the route starting point and the route end point do not coincide, the object is indicated to reach the route end point, and the object is instructed to execute a preset instruction corresponding to the route end point.
B14. The apparatus according to any of B9-14, further comprising a setting module adapted to set the orientation of the object when moving according to where the object is located.
B15. The apparatus of B14, the setup module further adapted to:
respectively acquiring screen coordinates of a line segment starting point and a line segment ending point of a line segment corresponding to the position of an object, wherein the screen coordinates comprise an abscissa and an ordinate;
when the abscissa of the starting point of the line segment is equal to the abscissa of the end point of the line segment, respectively acquiring the screen coordinates of the starting point of the line segment and the end point of the line segment of the next line segment connected with the line segment;
setting the direction of the object when moving to the horizontal right when the abscissa of the start point of the next line segment is smaller than the abscissa of the end point of the line segment;
when the abscissa of the start point of the next line segment is larger than the abscissa of the end point of the line segment, the orientation when the object moves is set to the horizontal left.
B16. The apparatus of B15, the setup module further adapted to:
setting an orientation when the object moves to the horizontal right when the abscissa of the start point of the segment is smaller than the abscissa of the end point of the segment;
when the abscissa of the start point of the line segment is larger than the abscissa of the end point of the line segment, the orientation when the object moves is set to the horizontal left.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules or units or groups of devices in the examples disclosed herein may be arranged in a device as described in this embodiment, or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into multiple sub-modules.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. Modules or units or groups in embodiments may be combined into one module or unit or group and may furthermore be divided into sub-modules or sub-units or sub-groups. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
Furthermore, some of the described embodiments are described herein as a method or combination of method elements that can be performed by a processor of a computer system or by other means of performing the described functions. A processor having the necessary instructions for carrying out the method or method elements thus forms a means for carrying out the method or method elements. Further, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is used to implement the functions performed by the elements for the purpose of carrying out the invention.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as floppy diskettes, CD-ROMs, hard drives, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the computing device will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to perform the method of locating an object of the present invention according to instructions in the program code stored in the memory.
By way of example, and not limitation, computer readable media may comprise computer storage media and communication media. Computer-readable media includes both computer storage media and communication media. Computer storage media store information such as computer readable instructions, data structures, program modules or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of computer readable media.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this description, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The present invention has been disclosed in an illustrative rather than a restrictive sense, and the scope of the present invention is defined by the appended claims.

Claims (19)

1. A method of locating an object, adapted to be performed in a mobile terminal, the object moving from a route start point to a route end point of a preset route, the preset route being composed of a plurality of line segments connected in sequence, each line segment having a corresponding line segment start point, line segment end point, minimum distance of the line segment start point from the route start point and maximum distance of the line segment end point from the route start point, wherein the line segment start point of a first line segment and the line segment end point of a last line segment are the route start point and the route end point, respectively, and the distance between the route start point and the route end point is the maximum length of the preset route, the method comprising:
acquiring a movement attribute and a movement time interval of the object, wherein the movement attribute comprises a current speed of the object and a current distance between the object and the route starting point;
calculating and updating the current distance according to the movement attribute and the movement time interval;
judging whether the current distance is smaller than the maximum length;
if the current distance is smaller than the maximum length, comparing the current distance with the minimum distance and the maximum distance of each line segment to obtain the line segment corresponding to the position to which the object should move currently;
and calculating a distance difference value of the current distance and the minimum distance of the corresponding line segment, and positioning the object to the position, away from the starting point of the line segment by the distance difference value, in the line segment.
2. The method of claim 1, the step of calculating and updating the current distance based on the movement attributes and movement time interval comprising:
obtaining the product of the current speed of the object and the moving time interval as a distance increment;
and calculating the sum of the distance increment and the current distance to update the current distance.
3. The method as claimed in claim 1 or 2, wherein the step of comparing the current distance with the minimum distance and the maximum distance of each line segment to obtain the line segment corresponding to the position to which the object should move currently comprises:
comparing the current distance with the minimum distance and the maximum distance of each line segment in sequence;
and acquiring a line segment of which the minimum distance is not more than the current distance and the maximum distance is not less than the current distance, and taking the line segment as a line segment corresponding to the position to which the object should be moved currently.
4. The method of claim 3, further comprising:
if the current distance is not smaller than the maximum length, judging whether the route starting point and the route end point are overlapped;
and if the route starting point and the route ending point are coincident, calculating the difference between the current distance and the maximum length so as to update the current distance.
5. The method of claim 4, further comprising:
if the route starting point and the route ending point are not coincident, the object is indicated to reach the route ending point, and the object is indicated to execute a preset instruction corresponding to the route ending point.
6. The method of claim 1, further comprising setting an orientation of the object as it moves based on where the object is located.
7. The method of claim 6, wherein the step of setting the orientation of the object when moving according to the position of the object comprises:
respectively acquiring screen coordinates of a line segment starting point and a line segment ending point of a line segment corresponding to the position of an object, wherein the screen coordinates comprise an abscissa and an ordinate;
if the abscissa of the starting point of the line segment is equal to the abscissa of the end point of the line segment, respectively acquiring the screen coordinates of the starting point of the line segment and the end point of the line segment of the next line segment connected with the line segment;
if the abscissa of the starting point of the next line segment is smaller than the abscissa of the ending point of the line segment, setting the direction of the object when moving to be horizontal and rightward;
if the abscissa of the start point of the next line segment is larger than the abscissa of the end point of the line segment, the orientation when the object moves is set to the horizontal left.
8. The method of claim 7, wherein the step of setting the orientation of the object when moving according to the position of the object further comprises:
if the abscissa of the starting point of the line segment is smaller than the abscissa of the end point of the line segment, setting the direction of the object when moving to be horizontal and rightward;
and if the abscissa of the starting point of the line segment is larger than the abscissa of the end point of the line segment, setting the direction of the object when the object moves to be horizontal to the left.
9. An apparatus for locating an object adapted to reside in a mobile terminal, the object moving from a route start point to a route end point of a preset route, the preset route being comprised of a plurality of line segments connected in series, each line segment having a corresponding line segment start point, line segment end point, minimum distance of the line segment start point from the route start point and maximum distance of the line segment end point from the route start point, wherein the line segment start point of a first line segment and the line segment end point of a last line segment are the route start point and the route end point, respectively, and the distance between the route start point and the route end point is the maximum length of the preset route, the apparatus comprising:
a first obtaining module adapted to obtain a movement attribute and a movement time interval of the object, the movement attribute including a current speed of the object and a current distance of the object from the route start point;
the updating module is suitable for calculating and updating the current distance according to the movement attribute and the movement time interval;
the judging module is suitable for judging whether the current distance is smaller than the maximum length;
the second obtaining module is suitable for comparing the current distance with the minimum distance and the maximum distance of each line segment when the current distance is smaller than the maximum length so as to obtain the line segment corresponding to the position to which the object should move currently;
and the positioning module is suitable for calculating a distance difference value of the current distance and the minimum distance of the corresponding line segment, and positioning the object to the position, away from the starting point of the line segment by the distance difference value, in the line segment.
10. The apparatus of claim 9, the update module further adapted to:
obtaining the product of the current speed of the object and the moving time interval as a distance increment;
and calculating the sum of the distance increment and the current distance to update the current distance.
11. The apparatus of claim 9 or 10, the second obtaining module further adapted to:
comparing the current distance with the minimum distance and the maximum distance of each line segment in sequence;
and acquiring a line segment of which the minimum distance is not more than the current distance and the maximum distance is not less than the current distance, and taking the line segment as a line segment corresponding to the position to which the object should be moved currently.
12. The apparatus of claim 11, wherein:
the judging module is further adapted to judge whether the route starting point and the route ending point coincide with each other when the current distance is not less than the maximum length;
the updating module is further adapted to calculate a difference between the current distance and the maximum length to update the current distance when the route start point coincides with the route end point.
13. The apparatus of claim 12, further comprising an indication module adapted to:
when the route starting point and the route end point do not coincide, the object is indicated to reach the route end point, and the object is instructed to execute a preset instruction corresponding to the route end point.
14. The apparatus of claim 9, further comprising a setting module adapted to set an orientation of the object when moving according to where the object is located.
15. The apparatus of claim 14, the setup module further adapted to:
respectively acquiring screen coordinates of a line segment starting point and a line segment ending point of a line segment corresponding to the position of an object, wherein the screen coordinates comprise an abscissa and an ordinate;
when the abscissa of the starting point of the line segment is equal to the abscissa of the end point of the line segment, respectively acquiring the screen coordinates of the starting point of the line segment and the end point of the line segment of the next line segment connected with the line segment;
setting the direction of the object when moving to the horizontal right when the abscissa of the start point of the next line segment is smaller than the abscissa of the end point of the line segment;
when the abscissa of the start point of the next line segment is larger than the abscissa of the end point of the line segment, the orientation when the object moves is set to the horizontal left.
16. The apparatus of claim 15, the setup module further adapted to:
setting an orientation when the object moves to the horizontal right when the abscissa of the start point of the segment is smaller than the abscissa of the end point of the segment;
when the abscissa of the start point of the line segment is larger than the abscissa of the end point of the line segment, the orientation when the object moves is set to the horizontal left.
17. A mobile terminal comprising an apparatus for locating an object as claimed in any one of claims 9 to 16.
18. A mobile terminal, comprising:
one or more processors;
a memory; and
one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising instructions for performing any of the methods of claims 1-8.
19. A computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a mobile terminal, cause the mobile terminal to perform any of the methods of claims 1-8.
CN201710423424.2A 2017-06-07 2017-06-07 Method and device for positioning object and mobile terminal Active CN107261500B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710423424.2A CN107261500B (en) 2017-06-07 2017-06-07 Method and device for positioning object and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710423424.2A CN107261500B (en) 2017-06-07 2017-06-07 Method and device for positioning object and mobile terminal

Publications (2)

Publication Number Publication Date
CN107261500A CN107261500A (en) 2017-10-20
CN107261500B true CN107261500B (en) 2020-07-07

Family

ID=60067444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710423424.2A Active CN107261500B (en) 2017-06-07 2017-06-07 Method and device for positioning object and mobile terminal

Country Status (1)

Country Link
CN (1) CN107261500B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI773775B (en) * 2018-06-19 2022-08-11 遊戲橘子數位科技股份有限公司 System of real-time free combination force in tower defense games
CN109194856A (en) * 2018-09-30 2019-01-11 Oppo广东移动通信有限公司 The control method and electronic device of electronic device
CN113538894B (en) * 2020-10-13 2024-02-09 腾讯科技(深圳)有限公司 Vehicle positioning data processing method, device, computer equipment and storage medium
CN112240770A (en) * 2020-10-15 2021-01-19 浙江欣奕华智能科技有限公司 Method, device and terminal for generating robot motion trail
CN113075618A (en) * 2021-03-31 2021-07-06 苏州触达信息技术有限公司 Intelligent device positioning method, device and system, intelligent device and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5431411B2 (en) * 2011-05-24 2014-03-05 株式会社コナミデジタルエンタテインメント GAME DEVICE, GAME DEVICE CONTROL METHOD, AND PROGRAM
CN106693364B (en) * 2016-04-28 2018-07-17 广州多益网络股份有限公司 Alleviate the method that the Skill aims detection of game services end calculates pressure
CN106075906B (en) * 2016-06-03 2019-07-05 腾讯科技(深圳)有限公司 The building method and corresponding device of a kind of method for searching of simulated object, scene
CN106651987B (en) * 2016-10-10 2018-12-07 腾讯科技(深圳)有限公司 Paths planning method and device
CN106422330B (en) * 2016-10-14 2019-10-29 网易(杭州)网络有限公司 The method for searching and device of unit
CN106582023B (en) * 2016-12-01 2020-06-02 北京像素软件科技股份有限公司 Game way finding method and device

Also Published As

Publication number Publication date
CN107261500A (en) 2017-10-20

Similar Documents

Publication Publication Date Title
CN107261500B (en) Method and device for positioning object and mobile terminal
CN107329750B (en) Identification method and skip method of advertisement page in application program and mobile terminal
CN111678532B (en) User terminal device for displaying map and method thereof
US11334169B2 (en) Systems and methods for content-aware selection
KR102281172B1 (en) Metadata-based photo and/or video animation
KR20150103158A (en) Audio control process
CN107656866B (en) Method for testing application fluency, mobile terminal and computing device
US9372613B2 (en) Scrolling method and electronic device thereof
CN103729120A (en) Method for generating thumbnail image and electronic device thereof
CN107308641B (en) Game object management method and device and mobile terminal
CN107153546B (en) Video playing method and mobile device
KR20190030023A (en) Apparatus for recommending user's privacy control and method for the same
KR20220062400A (en) Projection method and system
KR100970121B1 (en) Method, system, and computer-readable recording medium for performing image matching adaptively according to various conditions
WO2015070812A1 (en) Content typesetting method and mobile terminal
CN111373728B (en) Control method and device for camera application
CN110727893B (en) Waterfall flow picture loading method and device and mobile terminal
CN111679875A (en) Page content display method and system and mobile terminal
KR20180111242A (en) Electronic device and method for providing colorable content
CN104077077A (en) Method and device for adjusting prompt characters in input method
CN111444143B (en) Picture display method and device in picture set and mobile terminal
KR20180122137A (en) Method for giving dynamic effect to video and electronic device thereof
CN111931200A (en) Data serialization method, mobile terminal and readable storage medium
CN108804258B (en) Data recovery method and device, mobile terminal and storage medium
CN108549702B (en) Method for cleaning picture library of mobile terminal and mobile terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant